aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco_pci.c
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2006-04-07 04:11:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-04-24 16:15:52 -0400
commitdc3437d205dcd1a195ebf795f1c54ceb638337fb (patch)
tree0537c6ad05795a090a908d10e418f213817a4ee1 /drivers/net/wireless/orinoco_pci.c
parentb884c872fa1917614b42a39020ffcca7fa9302b1 (diff)
[PATCH] orinoco: further comment cleanup in the PCI drivers
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco_pci.c')
-rw-r--r--drivers/net/wireless/orinoco_pci.c69
1 files changed, 11 insertions, 58 deletions
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c
index 41efac22ba6a..df37b95607ff 100644
--- a/drivers/net/wireless/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco_pci.c
@@ -1,11 +1,11 @@
1/* orinoco_pci.c 1/* orinoco_pci.c
2 * 2 *
3 * Driver for Prism II devices that have a direct PCI interface 3 * Driver for Prism 2.5/3 devices that have a direct PCI interface
4 * (i.e., not in a Pcmcia or PLX bridge) 4 * (i.e. these are not PCMCIA cards in a PCMCIA-to-PCI bridge).
5 * 5 * The card contains only one PCI region, which contains all the usual
6 * Specifically here we're talking about the Linksys WMP11 6 * hermes registers, as well as the COR register.
7 * 7 *
8 * Current maintainers (as of 29 September 2003) are: 8 * Current maintainers are:
9 * Pavel Roskin <proski AT gnu.org> 9 * Pavel Roskin <proski AT gnu.org>
10 * and David Gibson <hermes AT gibson.dropbear.id.au> 10 * and David Gibson <hermes AT gibson.dropbear.id.au>
11 * 11 *
@@ -41,54 +41,6 @@
41 * under either the MPL or the GPL. 41 * under either the MPL or the GPL.
42 */ 42 */
43 43
44/*
45 * Theory of operation...
46 * -------------------
47 * Maybe you had a look in orinoco_plx. Well, this is totally different...
48 *
49 * The card contains only one PCI region, which contains all the usual
50 * hermes registers.
51 *
52 * The driver will memory map this region in normal memory. Because
53 * the hermes registers are mapped in normal memory and not in ISA I/O
54 * post space, we can't use the usual inw/outw macros and we need to
55 * use readw/writew.
56 * This slight difference force us to compile our own version of
57 * hermes.c with the register access macro changed. That's a bit
58 * hackish but works fine.
59 *
60 * Note that the PCI region is pretty big (4K). That's much more than
61 * the usual set of hermes register (0x0 -> 0x3E). I've got a strong
62 * suspicion that the whole memory space of the adapter is in fact in
63 * this region. Accessing directly the adapter memory instead of going
64 * through the usual register would speed up significantely the
65 * operations...
66 *
67 * Finally, the card looks like this :
68-----------------------
69 Bus 0, device 14, function 0:
70 Network controller: PCI device 1260:3873 (Harris Semiconductor) (rev 1).
71 IRQ 11.
72 Master Capable. Latency=248.
73 Prefetchable 32 bit memory at 0xffbcc000 [0xffbccfff].
74-----------------------
7500:0e.0 Network controller: Harris Semiconductor: Unknown device 3873 (rev 01)
76 Subsystem: Unknown device 1737:3874
77 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
78 Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
79 Latency: 248 set, cache line size 08
80 Interrupt: pin A routed to IRQ 11
81 Region 0: Memory at ffbcc000 (32-bit, prefetchable) [size=4K]
82 Capabilities: [dc] Power Management version 2
83 Flags: PMEClk- AuxPwr- DSI- D1+ D2+ PME+
84 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
85-----------------------
86 *
87 * That's all..
88 *
89 * Jean II
90 */
91
92#define DRIVER_NAME "orinoco_pci" 44#define DRIVER_NAME "orinoco_pci"
93#define PFX DRIVER_NAME ": " 45#define PFX DRIVER_NAME ": "
94 46
@@ -102,11 +54,12 @@
102#include "orinoco.h" 54#include "orinoco.h"
103#include "orinoco_pci.h" 55#include "orinoco_pci.h"
104 56
105/* All the magic there is from wlan-ng */ 57/* Offset of the COR register of the PCI card */
106/* Magic offset of the reset register of the PCI card */
107#define HERMES_PCI_COR (0x26) 58#define HERMES_PCI_COR (0x26)
108/* Magic bitmask to reset the card */ 59
60/* Bitmask to reset the card */
109#define HERMES_PCI_COR_MASK (0x0080) 61#define HERMES_PCI_COR_MASK (0x0080)
62
110/* Magic timeouts for doing the reset. 63/* Magic timeouts for doing the reset.
111 * Those times are straight from wlan-ng, and it is claimed that they 64 * Those times are straight from wlan-ng, and it is claimed that they
112 * are necessary. Alan will kill me. Take your time and grab a coffee. */ 65 * are necessary. Alan will kill me. Take your time and grab a coffee. */
@@ -115,7 +68,7 @@
115#define HERMES_PCI_COR_BUSYT (500) /* ms */ 68#define HERMES_PCI_COR_BUSYT (500) /* ms */
116 69
117/* 70/*
118 * Do a soft reset of the PCI card using the Configuration Option Register 71 * Do a soft reset of the card using the Configuration Option Register
119 * We need this to get going... 72 * We need this to get going...
120 * This is the part of the code that is strongly inspired from wlan-ng 73 * This is the part of the code that is strongly inspired from wlan-ng
121 * 74 *
@@ -133,7 +86,7 @@ static int orinoco_pci_cor_reset(struct orinoco_private *priv)
133 unsigned long timeout; 86 unsigned long timeout;
134 u16 reg; 87 u16 reg;
135 88
136 /* Assert the reset until the card notice */ 89 /* Assert the reset until the card notices */
137 hermes_write_regn(hw, PCI_COR, HERMES_PCI_COR_MASK); 90 hermes_write_regn(hw, PCI_COR, HERMES_PCI_COR_MASK);
138 mdelay(HERMES_PCI_COR_ONT); 91 mdelay(HERMES_PCI_COR_ONT);
139 92