Browse Source

Updated to new device API.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
0e2dc7aa8e
3 changed files with 51 additions and 34 deletions
  1. 0
    1
      src/drivers/net/prism2.c
  2. 22
    13
      src/drivers/net/prism2_pci.c
  3. 29
    20
      src/drivers/net/prism2_plx.c

+ 0
- 1
src/drivers/net/prism2.c View File

@@ -748,7 +748,6 @@ static struct nic_operations prism2_operations = {
748 748
 	.poll		= prism2_poll,
749 749
 	.transmit	= prism2_transmit,
750 750
 	.irq		= prism2_irq,
751
-	.disable	= prism2_disable,
752 751
 };
753 752
 
754 753
 /**************************************************************************

+ 22
- 13
src/drivers/net/prism2_pci.c View File

@@ -14,23 +14,17 @@ $Id$
14 14
  * your option) any later version.
15 15
  */
16 16
 
17
+#include "pci.h"
18
+#include "nic.h"
19
+
17 20
 #define WLAN_HOSTIF WLAN_PCI
18 21
 #include "prism2.c"
19 22
 
20
-static struct pci_id prism2_pci_nics[] = {
21
-PCI_ROM(0x1260, 0x3873, "prism2_pci",	"Harris Semiconductor Prism2.5 clone"),
22
-PCI_ROM(0x1260, 0x3873, "hwp01170",	"ActionTec HWP01170"),
23
-PCI_ROM(0x1260, 0x3873, "dwl520",	"DLink DWL-520"),
24
-};
25
-
26
-static struct pci_driver prism2_pci_driver =
27
-	PCI_DRIVER ( "Prism2_PCI", prism2_pci_nics, PCI_NO_CLASS );
28
-
29
-static int prism2_pci_probe ( struct dev *dev, struct pci_device *pci ) {
30
-  struct nic *nic = nic_device ( dev );
23
+static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) {
31 24
   hfa384x_t *hw = &hw_global;
32 25
   uint32_t membase = 0; /* Prism2.5 Memory Base */
33 26
 
27
+  pci_fill_nic ( nic, pci );
34 28
   pci_read_config_dword( pci, PRISM2_PCI_MEM_BASE, &membase);
35 29
   membase &= PCI_BASE_ADDRESS_MEM_MASK;
36 30
   hw->membase = (uint32_t) phys_to_virt(membase);
@@ -38,7 +32,22 @@ static int prism2_pci_probe ( struct dev *dev, struct pci_device *pci ) {
38 32
   nic->ioaddr = hw->membase;
39 33
 
40 34
   return prism2_probe ( nic, hw );
41
-}   
35
+}
36
+
37
+static void prism2_pci_disable ( struct nic *nic,
38
+				 struct pci_device *pci __unused ) {
39
+  prism2_disable ( nic );
40
+}
41
+
42
+static struct pci_id prism2_pci_nics[] = {
43
+PCI_ROM(0x1260, 0x3873, "prism2_pci",	"Harris Semiconductor Prism2.5 clone"),
44
+PCI_ROM(0x1260, 0x3873, "hwp01170",	"ActionTec HWP01170"),
45
+PCI_ROM(0x1260, 0x3873, "dwl520",	"DLink DWL-520"),
46
+};
47
+
48
+static struct pci_driver prism2_pci_driver =
49
+	PCI_DRIVER ( prism2_pci_nics, PCI_NO_CLASS );
42 50
 
43
-BOOT_DRIVER ( "Prism2_PCI", find_pci_boot_device, prism2_pci_driver, prism2_pci_probe );
51
+DRIVER ( "Prism2/PCI", nic_driver, pci_driver, prism2_pci_driver,
52
+	 prism2_pci_probe, prism2_pci_disable );
44 53
 

+ 29
- 20
src/drivers/net/prism2_plx.c View File

@@ -14,26 +14,12 @@ $Id$
14 14
  * your option) any later version.
15 15
  */
16 16
 
17
+#include "pci.h"
18
+#include "nic.h"
19
+
17 20
 #define WLAN_HOSTIF WLAN_PLX
18 21
 #include "prism2.c"
19 22
 
20
-static struct pci_id prism2_plx_nics[] = {
21
-PCI_ROM(0x1385, 0x4100, "ma301",         "Netgear MA301"),
22
-PCI_ROM(0x10b7, 0x7770, "3c-airconnect", "3Com AirConnect"),
23
-PCI_ROM(0x111a, 0x1023, "ss1023",        "Siemens SpeedStream SS1023"),
24
-PCI_ROM(0x15e8, 0x0130, "correga",       "Correga"),
25
-PCI_ROM(0x1638, 0x1100, "smc2602w",      "SMC EZConnect SMC2602W"),	/* or Eumitcom PCI WL11000, Addtron AWA-100 */
26
-PCI_ROM(0x16ab, 0x1100, "gl24110p",      "Global Sun Tech GL24110P"),
27
-PCI_ROM(0x16ab, 0x1101, "16ab-1101",     "Unknown"),
28
-PCI_ROM(0x16ab, 0x1102, "wdt11",         "Linksys WDT11"),
29
-PCI_ROM(0x16ec, 0x3685, "usr2415",       "USR 2415"),
30
-PCI_ROM(0xec80, 0xec00, "f5d6000",       "Belkin F5D6000"),
31
-PCI_ROM(0x126c, 0x8030, "emobility",     "Nortel emobility"),
32
-};
33
-
34
-static struct pci_driver prism2_plx_driver =
35
-	PCI_DRIVER ( "Prism2_PLX", prism2_plx_nics, PCI_NO_CLASS );
36
-
37 23
 /*
38 24
  * Find PLX card.  Prints out information strings from PCMCIA CIS as visual
39 25
  * confirmation of presence of card.
@@ -92,8 +78,7 @@ static int prism2_find_plx ( hfa384x_t *hw, struct pci_device *p )
92 78
   return found;
93 79
 }
94 80
 
95
-static int prism2_plx_probe ( struct dev *dev, struct pci_device *pci ) {
96
-  struct nic *nic = nic_device ( dev );
81
+static int prism2_plx_probe ( struct nic *nic, struct pci_device *pci ) {
97 82
   hfa384x_t *hw = &hw_global;
98 83
 
99 84
   /* Find and intialise PLX Prism2 card */
@@ -103,5 +88,29 @@ static int prism2_plx_probe ( struct dev *dev, struct pci_device *pci ) {
103 88
   return prism2_probe ( nic, hw );
104 89
 }
105 90
 
106
-BOOT_DRIVER ( "Prism2_PLX", find_pci_boot_device, prism2_plx_driver, prism2_plx_probe );
91
+static void prism2_plx_disable ( struct nic *nic,
92
+				 struct pci_device *pci __unused ) {
93
+  prism2_disable ( nic );
94
+}
95
+
96
+static struct pci_id prism2_plx_nics[] = {
97
+PCI_ROM(0x1385, 0x4100, "ma301",         "Netgear MA301"),
98
+PCI_ROM(0x10b7, 0x7770, "3c-airconnect", "3Com AirConnect"),
99
+PCI_ROM(0x111a, 0x1023, "ss1023",        "Siemens SpeedStream SS1023"),
100
+PCI_ROM(0x15e8, 0x0130, "correga",       "Correga"),
101
+PCI_ROM(0x1638, 0x1100, "smc2602w",      "SMC EZConnect SMC2602W"),	/* or Eumitcom PCI WL11000, Addtron AWA-100 */
102
+PCI_ROM(0x16ab, 0x1100, "gl24110p",      "Global Sun Tech GL24110P"),
103
+PCI_ROM(0x16ab, 0x1101, "16ab-1101",     "Unknown"),
104
+PCI_ROM(0x16ab, 0x1102, "wdt11",         "Linksys WDT11"),
105
+PCI_ROM(0x16ec, 0x3685, "usr2415",       "USR 2415"),
106
+PCI_ROM(0xec80, 0xec00, "f5d6000",       "Belkin F5D6000"),
107
+PCI_ROM(0x126c, 0x8030, "emobility",     "Nortel emobility"),
108
+};
109
+
110
+static struct pci_driver prism2_plx_driver =
111
+	PCI_DRIVER ( prism2_plx_nics, PCI_NO_CLASS );
112
+
113
+
114
+DRIVER ( "Prism2/PLX", nic_driver, pci_driver, prism2_plx_driver,
115
+	 prism2_plx_probe, prism2_plx_disable );
107 116
 

Loading…
Cancel
Save