Commit 996ff103 authored by David Gibson's avatar David Gibson Committed by Jeff Garzik

[PATCH] orinoco merge preliminaries - comment/whitespace/spelling updates

Various trivial cleanups to the orinoco driver: whitespace changes,
spelling/capitalization errors corrected, some fairly insignificant
comments added, removed or reformatted.
Signed-off-by: default avatarDavid Gibson <hermes@gibson.dropbear.id.au>

Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
parent c56331db
...@@ -390,7 +390,6 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset) ...@@ -390,7 +390,6 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset)
return -EIO; return -EIO;
} }
return 0; return 0;
} }
......
...@@ -124,22 +124,22 @@ ...@@ -124,22 +124,22 @@
/* /*
* Command codes * Command codes
*/ */
/*--- Controller Commands --------------------------*/ /*--- Controller Commands ----------------------------*/
#define HERMES_CMD_INIT (0x0000) #define HERMES_CMD_INIT (0x0000)
#define HERMES_CMD_ENABLE (0x0001) #define HERMES_CMD_ENABLE (0x0001)
#define HERMES_CMD_DISABLE (0x0002) #define HERMES_CMD_DISABLE (0x0002)
#define HERMES_CMD_DIAG (0x0003) #define HERMES_CMD_DIAG (0x0003)
/*--- Buffer Mgmt Commands --------------------------*/ /*--- Buffer Mgmt Commands ---------------------------*/
#define HERMES_CMD_ALLOC (0x000A) #define HERMES_CMD_ALLOC (0x000A)
#define HERMES_CMD_TX (0x000B) #define HERMES_CMD_TX (0x000B)
#define HERMES_CMD_CLRPRST (0x0012) #define HERMES_CMD_CLRPRST (0x0012)
/*--- Regulate Commands --------------------------*/ /*--- Regulate Commands ------------------------------*/
#define HERMES_CMD_NOTIFY (0x0010) #define HERMES_CMD_NOTIFY (0x0010)
#define HERMES_CMD_INQUIRE (0x0011) #define HERMES_CMD_INQUIRE (0x0011)
/*--- Configure Commands --------------------------*/ /*--- Configure Commands -----------------------------*/
#define HERMES_CMD_ACCESS (0x0021) #define HERMES_CMD_ACCESS (0x0021)
#define HERMES_CMD_DOWNLD (0x0022) #define HERMES_CMD_DOWNLD (0x0022)
...@@ -312,9 +312,11 @@ typedef struct hermes { ...@@ -312,9 +312,11 @@ typedef struct hermes {
#define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val)) #define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val))
/* Function prototypes */ /* Function prototypes */
void hermes_struct_init(hermes_t *hw, ulong address, int io_space, int reg_spacing); void hermes_struct_init(hermes_t *hw, ulong address, int io_space,
int reg_spacing);
int hermes_init(hermes_t *hw); int hermes_init(hermes_t *hw);
int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, hermes_response_t *resp); int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0,
hermes_response_t *resp);
int hermes_allocate(hermes_t *hw, u16 size, u16 *fid); int hermes_allocate(hermes_t *hw, u16 size, u16 *fid);
int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len, int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len,
......
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
/* /*
* Configuration RIDs * Configuration RIDs
*/ */
#define HERMES_RID_CNFPORTTYPE 0xFC00 /* used */ #define HERMES_RID_CNFPORTTYPE 0xFC00
#define HERMES_RID_CNFOWNMACADDR 0xFC01 /* used */ #define HERMES_RID_CNFOWNMACADDR 0xFC01
#define HERMES_RID_CNFDESIREDSSID 0xFC02 /* used */ #define HERMES_RID_CNFDESIREDSSID 0xFC02
#define HERMES_RID_CNFOWNCHANNEL 0xFC03 /* used */ #define HERMES_RID_CNFOWNCHANNEL 0xFC03
#define HERMES_RID_CNFOWNSSID 0xFC04 /* used */ #define HERMES_RID_CNFOWNSSID 0xFC04
#define HERMES_RID_CNFOWNATIMWINDOW 0xFC05 #define HERMES_RID_CNFOWNATIMWINDOW 0xFC05
#define HERMES_RID_CNFSYSTEMSCALE 0xFC06 /* used */ #define HERMES_RID_CNFSYSTEMSCALE 0xFC06
#define HERMES_RID_CNFMAXDATALEN 0xFC07 #define HERMES_RID_CNFMAXDATALEN 0xFC07
#define HERMES_RID_CNFWDSADDRESS 0xFC08 #define HERMES_RID_CNFWDSADDRESS 0xFC08
#define HERMES_RID_CNFPMENABLED 0xFC09 /* used */ #define HERMES_RID_CNFPMENABLED 0xFC09
#define HERMES_RID_CNFPMEPS 0xFC0A #define HERMES_RID_CNFPMEPS 0xFC0A
#define HERMES_RID_CNFMULTICASTRECEIVE 0xFC0B /* used */ #define HERMES_RID_CNFMULTICASTRECEIVE 0xFC0B
#define HERMES_RID_CNFMAXSLEEPDURATION 0xFC0C /* used */ #define HERMES_RID_CNFMAXSLEEPDURATION 0xFC0C
#define HERMES_RID_CNFPMHOLDOVERDURATION 0xFC0D /* used */ #define HERMES_RID_CNFPMHOLDOVERDURATION 0xFC0D
#define HERMES_RID_CNFOWNNAME 0xFC0E /* used */ #define HERMES_RID_CNFOWNNAME 0xFC0E
#define HERMES_RID_CNFOWNDTIMPERIOD 0xFC10 #define HERMES_RID_CNFOWNDTIMPERIOD 0xFC10
#define HERMES_RID_CNFWDSADDRESS1 0xFC11 #define HERMES_RID_CNFWDSADDRESS1 0xFC11
#define HERMES_RID_CNFWDSADDRESS2 0xFC12 #define HERMES_RID_CNFWDSADDRESS2 0xFC12
...@@ -27,17 +27,17 @@ ...@@ -27,17 +27,17 @@
#define HERMES_RID_CNFWDSADDRESS5 0xFC15 #define HERMES_RID_CNFWDSADDRESS5 0xFC15
#define HERMES_RID_CNFWDSADDRESS6 0xFC16 #define HERMES_RID_CNFWDSADDRESS6 0xFC16
#define HERMES_RID_CNFMULTICASTPMBUFFERING 0xFC17 #define HERMES_RID_CNFMULTICASTPMBUFFERING 0xFC17
#define HERMES_RID_CNFWEPENABLED_AGERE 0xFC20 /* used */ #define HERMES_RID_CNFWEPENABLED_AGERE 0xFC20
#define HERMES_RID_CNFMANDATORYBSSID_SYMBOL 0xFC21 #define HERMES_RID_CNFMANDATORYBSSID_SYMBOL 0xFC21
#define HERMES_RID_CNFWEPDEFAULTKEYID 0xFC23 /* used */ #define HERMES_RID_CNFWEPDEFAULTKEYID 0xFC23
#define HERMES_RID_CNFDEFAULTKEY0 0xFC24 /* used */ #define HERMES_RID_CNFDEFAULTKEY0 0xFC24
#define HERMES_RID_CNFDEFAULTKEY1 0xFC25 /* used */ #define HERMES_RID_CNFDEFAULTKEY1 0xFC25
#define HERMES_RID_CNFMWOROBUST_AGERE 0xFC25 /* used */ #define HERMES_RID_CNFMWOROBUST_AGERE 0xFC25
#define HERMES_RID_CNFDEFAULTKEY2 0xFC26 /* used */ #define HERMES_RID_CNFDEFAULTKEY2 0xFC26
#define HERMES_RID_CNFDEFAULTKEY3 0xFC27 /* used */ #define HERMES_RID_CNFDEFAULTKEY3 0xFC27
#define HERMES_RID_CNFWEPFLAGS_INTERSIL 0xFC28 /* used */ #define HERMES_RID_CNFWEPFLAGS_INTERSIL 0xFC28
#define HERMES_RID_CNFWEPKEYMAPPINGTABLE 0xFC29 #define HERMES_RID_CNFWEPKEYMAPPINGTABLE 0xFC29
#define HERMES_RID_CNFAUTHENTICATION 0xFC2A /* used */ #define HERMES_RID_CNFAUTHENTICATION 0xFC2A
#define HERMES_RID_CNFMAXASSOCSTA 0xFC2B #define HERMES_RID_CNFMAXASSOCSTA 0xFC2B
#define HERMES_RID_CNFKEYLENGTH_SYMBOL 0xFC2B #define HERMES_RID_CNFKEYLENGTH_SYMBOL 0xFC2B
#define HERMES_RID_CNFTXCONTROL 0xFC2C #define HERMES_RID_CNFTXCONTROL 0xFC2C
...@@ -53,14 +53,14 @@ ...@@ -53,14 +53,14 @@
#define HERMES_RID_CNFTIMCTRL 0xFC40 #define HERMES_RID_CNFTIMCTRL 0xFC40
#define HERMES_RID_CNFTHIRTY2TALLY 0xFC42 #define HERMES_RID_CNFTHIRTY2TALLY 0xFC42
#define HERMES_RID_CNFENHSECURITY 0xFC43 #define HERMES_RID_CNFENHSECURITY 0xFC43
#define HERMES_RID_CNFGROUPADDRESSES 0xFC80 /* used */ #define HERMES_RID_CNFGROUPADDRESSES 0xFC80
#define HERMES_RID_CNFCREATEIBSS 0xFC81 /* used */ #define HERMES_RID_CNFCREATEIBSS 0xFC81
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD 0xFC82 /* used */ #define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD 0xFC82
#define HERMES_RID_CNFRTSTHRESHOLD 0xFC83 /* used */ #define HERMES_RID_CNFRTSTHRESHOLD 0xFC83
#define HERMES_RID_CNFTXRATECONTROL 0xFC84 /* used */ #define HERMES_RID_CNFTXRATECONTROL 0xFC84
#define HERMES_RID_CNFPROMISCUOUSMODE 0xFC85 /* used */ #define HERMES_RID_CNFPROMISCUOUSMODE 0xFC85
#define HERMES_RID_CNFBASICRATES_SYMBOL 0xFC8A #define HERMES_RID_CNFBASICRATES_SYMBOL 0xFC8A
#define HERMES_RID_CNFPREAMBLE_SYMBOL 0xFC8C /* used */ #define HERMES_RID_CNFPREAMBLE_SYMBOL 0xFC8C
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD0 0xFC90 #define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD0 0xFC90
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD1 0xFC91 #define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD1 0xFC91
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD2 0xFC92 #define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD2 0xFC92
...@@ -76,13 +76,13 @@ ...@@ -76,13 +76,13 @@
#define HERMES_RID_CNFRTSTHRESHOLD5 0xFC9C #define HERMES_RID_CNFRTSTHRESHOLD5 0xFC9C
#define HERMES_RID_CNFRTSTHRESHOLD6 0xFC9D #define HERMES_RID_CNFRTSTHRESHOLD6 0xFC9D
#define HERMES_RID_CNFSHORTPREAMBLE 0xFCB0 #define HERMES_RID_CNFSHORTPREAMBLE 0xFCB0
#define HERMES_RID_CNFWEPKEYS_AGERE 0xFCB0 /* used */ #define HERMES_RID_CNFWEPKEYS_AGERE 0xFCB0
#define HERMES_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1 #define HERMES_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1
#define HERMES_RID_CNFTXKEY_AGERE 0xFCB1 /* used */ #define HERMES_RID_CNFTXKEY_AGERE 0xFCB1
#define HERMES_RID_CNFAUTHENTICATIONRSPTO 0xFCB2 #define HERMES_RID_CNFAUTHENTICATIONRSPTO 0xFCB2
#define HERMES_RID_CNFBASICRATES 0xFCB3 #define HERMES_RID_CNFBASICRATES 0xFCB3
#define HERMES_RID_CNFSUPPORTEDRATES 0xFCB4 #define HERMES_RID_CNFSUPPORTEDRATES 0xFCB4
#define HERMES_RID_CNFTICKTIME 0xFCE0 /* used */ #define HERMES_RID_CNFTICKTIME 0xFCE0
#define HERMES_RID_CNFSCANREQUEST 0xFCE1 #define HERMES_RID_CNFSCANREQUEST 0xFCE1
#define HERMES_RID_CNFJOINREQUEST 0xFCE2 #define HERMES_RID_CNFJOINREQUEST 0xFCE2
#define HERMES_RID_CNFAUTHENTICATESTATION 0xFCE3 #define HERMES_RID_CNFAUTHENTICATESTATION 0xFCE3
...@@ -100,26 +100,26 @@ ...@@ -100,26 +100,26 @@
#define HERMES_RID_NICID 0xFD0B #define HERMES_RID_NICID 0xFD0B
#define HERMES_RID_MFISUPRANGE 0xFD0C #define HERMES_RID_MFISUPRANGE 0xFD0C
#define HERMES_RID_CFISUPRANGE 0xFD0D #define HERMES_RID_CFISUPRANGE 0xFD0D
#define HERMES_RID_CHANNELLIST 0xFD10 /* used */ #define HERMES_RID_CHANNELLIST 0xFD10
#define HERMES_RID_REGULATORYDOMAINS 0xFD11 #define HERMES_RID_REGULATORYDOMAINS 0xFD11
#define HERMES_RID_TEMPTYPE 0xFD12 #define HERMES_RID_TEMPTYPE 0xFD12
#define HERMES_RID_CIS 0xFD13 #define HERMES_RID_CIS 0xFD13
#define HERMES_RID_STAID 0xFD20 /* used */ #define HERMES_RID_STAID 0xFD20
#define HERMES_RID_STASUPRANGE 0xFD21 #define HERMES_RID_STASUPRANGE 0xFD21
#define HERMES_RID_MFIACTRANGES 0xFD22 #define HERMES_RID_MFIACTRANGES 0xFD22
#define HERMES_RID_CFIACTRANGES2 0xFD23 #define HERMES_RID_CFIACTRANGES2 0xFD23
#define HERMES_RID_SECONDARYVERSION_SYMBOL 0xFD24 /* used */ #define HERMES_RID_SECONDARYVERSION_SYMBOL 0xFD24
#define HERMES_RID_PORTSTATUS 0xFD40 #define HERMES_RID_PORTSTATUS 0xFD40
#define HERMES_RID_CURRENTSSID 0xFD41 /* used */ #define HERMES_RID_CURRENTSSID 0xFD41
#define HERMES_RID_CURRENTBSSID 0xFD42 /* used */ #define HERMES_RID_CURRENTBSSID 0xFD42
#define HERMES_RID_COMMSQUALITY 0xFD43 /* used */ #define HERMES_RID_COMMSQUALITY 0xFD43
#define HERMES_RID_CURRENTTXRATE 0xFD44 /* used */ #define HERMES_RID_CURRENTTXRATE 0xFD44
#define HERMES_RID_CURRENTBEACONINTERVAL 0xFD45 #define HERMES_RID_CURRENTBEACONINTERVAL 0xFD45
#define HERMES_RID_CURRENTSCALETHRESHOLDS 0xFD46 #define HERMES_RID_CURRENTSCALETHRESHOLDS 0xFD46
#define HERMES_RID_PROTOCOLRSPTIME 0xFD47 #define HERMES_RID_PROTOCOLRSPTIME 0xFD47
#define HERMES_RID_SHORTRETRYLIMIT 0xFD48 /* used */ #define HERMES_RID_SHORTRETRYLIMIT 0xFD48
#define HERMES_RID_LONGRETRYLIMIT 0xFD49 /* used */ #define HERMES_RID_LONGRETRYLIMIT 0xFD49
#define HERMES_RID_MAXTRANSMITLIFETIME 0xFD4A /* used */ #define HERMES_RID_MAXTRANSMITLIFETIME 0xFD4A
#define HERMES_RID_MAXRECEIVELIFETIME 0xFD4B #define HERMES_RID_MAXRECEIVELIFETIME 0xFD4B
#define HERMES_RID_CFPOLLABLE 0xFD4C #define HERMES_RID_CFPOLLABLE 0xFD4C
#define HERMES_RID_AUTHENTICATIONALGORITHMS 0xFD4D #define HERMES_RID_AUTHENTICATIONALGORITHMS 0xFD4D
...@@ -133,10 +133,10 @@ ...@@ -133,10 +133,10 @@
#define HERMES_RID_OWNMACADDR 0xFD86 #define HERMES_RID_OWNMACADDR 0xFD86
#define HERMES_RID_SCANRESULTSTABLE 0xFD88 #define HERMES_RID_SCANRESULTSTABLE 0xFD88
#define HERMES_RID_PHYTYPE 0xFDC0 #define HERMES_RID_PHYTYPE 0xFDC0
#define HERMES_RID_CURRENTCHANNEL 0xFDC1 /* used */ #define HERMES_RID_CURRENTCHANNEL 0xFDC1
#define HERMES_RID_CURRENTPOWERSTATE 0xFDC2 #define HERMES_RID_CURRENTPOWERSTATE 0xFDC2
#define HERMES_RID_CCAMODE 0xFDC3 #define HERMES_RID_CCAMODE 0xFDC3
#define HERMES_RID_SUPPORTEDDATARATES 0xFDC6 /* used */ #define HERMES_RID_SUPPORTEDDATARATES 0xFDC6
#define HERMES_RID_BUILDSEQ 0xFFFE #define HERMES_RID_BUILDSEQ 0xFFFE
#define HERMES_RID_FWID 0xFFFF #define HERMES_RID_FWID 0xFFFF
......
...@@ -76,4 +76,3 @@ struct ieee802_11_hdr { ...@@ -76,4 +76,3 @@ struct ieee802_11_hdr {
#define IEEE802_11_SCTL_SEQ 0xFFF0 #define IEEE802_11_SCTL_SEQ 0xFFF0
#endif /* _IEEE802_11_H */ #endif /* _IEEE802_11_H */
This diff is collapsed.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/version.h> #include <linux/version.h>
#include "hermes.h" #include "hermes.h"
/* To enable debug messages */ /* To enable debug messages */
...@@ -50,7 +51,6 @@ struct orinoco_private { ...@@ -50,7 +51,6 @@ struct orinoco_private {
hermes_t hw; hermes_t hw;
u16 txfid; u16 txfid;
/* Capabilities of the hardware/firmware */ /* Capabilities of the hardware/firmware */
int firmware_type; int firmware_type;
#define FIRMWARE_TYPE_AGERE 1 #define FIRMWARE_TYPE_AGERE 1
...@@ -100,6 +100,10 @@ extern int orinoco_debug; ...@@ -100,6 +100,10 @@ extern int orinoco_debug;
#define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", devname, __FUNCTION__); #define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", devname, __FUNCTION__);
#define TRACE_EXIT(devname) DEBUG(2, "%s: <- %s()\n", devname, __FUNCTION__); #define TRACE_EXIT(devname) DEBUG(2, "%s: <- %s()\n", devname, __FUNCTION__);
/********************************************************************/
/* Exported prototypes */
/********************************************************************/
extern struct net_device *alloc_orinocodev(int sizeof_card, extern struct net_device *alloc_orinocodev(int sizeof_card,
int (*hard_reset)(struct orinoco_private *)); int (*hard_reset)(struct orinoco_private *));
extern int __orinoco_up(struct net_device *dev); extern int __orinoco_up(struct net_device *dev);
......
...@@ -219,8 +219,7 @@ orinoco_cs_attach(void) ...@@ -219,8 +219,7 @@ orinoco_cs_attach(void)
* are freed. Otherwise, the structures will be freed when the device * are freed. Otherwise, the structures will be freed when the device
* is released. * is released.
*/ */
static void static void orinoco_cs_detach(dev_link_t *link)
orinoco_cs_detach(dev_link_t * link)
{ {
dev_link_t **linkp; dev_link_t **linkp;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
...@@ -258,8 +257,9 @@ orinoco_cs_detach(dev_link_t * link) ...@@ -258,8 +257,9 @@ orinoco_cs_detach(dev_link_t * link)
* device available to the system. * device available to the system.
*/ */
#define CS_CHECK(fn, ret) \ #define CS_CHECK(fn, ret) do { \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
} while (0)
static void static void
orinoco_cs_config(dev_link_t *link) orinoco_cs_config(dev_link_t *link)
...@@ -297,7 +297,8 @@ orinoco_cs_config(dev_link_t *link) ...@@ -297,7 +297,8 @@ orinoco_cs_config(dev_link_t *link)
link->state |= DEV_CONFIG; link->state |= DEV_CONFIG;
/* Look up the current Vcc */ /* Look up the current Vcc */
CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf)); CS_CHECK(GetConfigurationInfo,
pcmcia_get_configuration_info(handle, &conf));
link->conf.Vcc = conf.Vcc; link->conf.Vcc = conf.Vcc;
/* /*
...@@ -401,8 +402,9 @@ orinoco_cs_config(dev_link_t *link) ...@@ -401,8 +402,9 @@ orinoco_cs_config(dev_link_t *link)
pcmcia_release_io(link->handle, &link->io); pcmcia_release_io(link->handle, &link->io);
last_ret = pcmcia_get_next_tuple(handle, &tuple); last_ret = pcmcia_get_next_tuple(handle, &tuple);
if (last_ret == CS_NO_MORE_ITEMS) { if (last_ret == CS_NO_MORE_ITEMS) {
printk(KERN_ERR "GetNextTuple(). No matching CIS configuration, " printk(KERN_ERR "GetNextTuple(). No matching "
"maybe you need the ignore_cis_vcc=1 parameter.\n"); "CIS configuration, maybe you need the "
"ignore_cis_vcc=1 parameter.\n");
goto cs_failed; goto cs_failed;
} }
} }
...@@ -440,7 +442,8 @@ orinoco_cs_config(dev_link_t *link) ...@@ -440,7 +442,8 @@ orinoco_cs_config(dev_link_t *link)
* the I/O windows and the interrupt mapping, and putting the * the I/O windows and the interrupt mapping, and putting the
* card and host interface into "Memory and IO" mode. * card and host interface into "Memory and IO" mode.
*/ */
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); CS_CHECK(RequestConfiguration,
pcmcia_request_configuration(link->handle, &link->conf));
/* Ok, we have the configuration, prepare to register the netdev */ /* Ok, we have the configuration, prepare to register the netdev */
dev->base_addr = link->io.BasePort1; dev->base_addr = link->io.BasePort1;
...@@ -659,4 +662,3 @@ exit_orinoco_cs(void) ...@@ -659,4 +662,3 @@ exit_orinoco_cs(void)
module_init(init_orinoco_cs); module_init(init_orinoco_cs);
module_exit(exit_orinoco_cs); module_exit(exit_orinoco_cs);
...@@ -206,18 +206,17 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, ...@@ -206,18 +206,17 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
if (! pci_iorange) if (! pci_iorange)
goto fail; goto fail;
/* Usual setup of structures */ /* Allocate network device */
dev = alloc_orinocodev(0, NULL); dev = alloc_orinocodev(0, NULL);
if (! dev) { if (! dev) {
err = -ENOMEM; err = -ENOMEM;
goto fail; goto fail;
} }
priv = netdev_priv(dev);
priv = netdev_priv(dev);
dev->base_addr = (unsigned long) pci_ioaddr; dev->base_addr = (unsigned long) pci_ioaddr;
dev->mem_start = pci_iorange; dev->mem_start = pci_iorange;
dev->mem_end = pci_iorange + pci_iolen - 1; dev->mem_end = pci_iorange + pci_iolen - 1;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
...@@ -238,6 +237,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, ...@@ -238,6 +237,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
goto fail; goto fail;
} }
dev->irq = pdev->irq; dev->irq = pdev->irq;
/* Perform a COR reset to start the card */ /* Perform a COR reset to start the card */
if(orinoco_pci_cor_reset(priv) != 0) { if(orinoco_pci_cor_reset(priv) != 0) {
printk(KERN_ERR "%s: Failed to start the card\n", dev->name); printk(KERN_ERR "%s: Failed to start the card\n", dev->name);
...@@ -255,7 +255,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, ...@@ -255,7 +255,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
goto fail; goto fail;
} }
return 0; /* succeeded */ return 0;
fail: fail:
if (dev) { if (dev) {
if (dev->irq) if (dev->irq)
...@@ -357,7 +358,9 @@ static int orinoco_pci_resume(struct pci_dev *pdev) ...@@ -357,7 +358,9 @@ static int orinoco_pci_resume(struct pci_dev *pdev)
} }
static struct pci_device_id orinoco_pci_pci_id_table[] = { static struct pci_device_id orinoco_pci_pci_id_table[] = {
/* Intersil Prism 3 */
{0x1260, 0x3872, PCI_ANY_ID, PCI_ANY_ID,}, {0x1260, 0x3872, PCI_ANY_ID, PCI_ANY_ID,},
/* Intersil Prism 2.5 */
{0x1260, 0x3873, PCI_ANY_ID, PCI_ANY_ID,}, {0x1260, 0x3873, PCI_ANY_ID, PCI_ANY_ID,},
{0,}, {0,},
}; };
......
...@@ -35,75 +35,78 @@ ...@@ -35,75 +35,78 @@
* Note: if everything gets detected fine but it doesn't actually send * Note: if everything gets detected fine but it doesn't actually send
* or receive packets, your first port of call should probably be to * or receive packets, your first port of call should probably be to
* try newer firmware in the card. Especially if you're doing Ad-Hoc * try newer firmware in the card. Especially if you're doing Ad-Hoc
* modes * modes.
* *
* The actual driving is done by orinoco.c, this is just resource * The actual driving is done by orinoco.c, this is just resource
* allocation stuff. The explanation below is courtesy of Ryan Niemi * allocation stuff. The explanation below is courtesy of Ryan Niemi
* on the linux-wlan-ng list at * on the linux-wlan-ng list at
* http://archives.neohapsis.com/archives/dev/linux-wlan/2001-q1/0026.html * http://archives.neohapsis.com/archives/dev/linux-wlan/2001-q1/0026.html
*
The PLX9052-based cards (WL11000 and several others) are a different * The PLX9052-based cards (WL11000 and several others) are a
beast than the usual PCMCIA-based PRISM2 configuration expected by * different beast than the usual PCMCIA-based PRISM2 configuration
wlan-ng. Here's the general details on how the WL11000 PCI adapter * expected by wlan-ng. Here's the general details on how the WL11000
works: * PCI adapter works:
*
- Two PCI I/O address spaces, one 0x80 long which contains the PLX9052 * - Two PCI I/O address spaces, one 0x80 long which contains the
registers, and one that's 0x40 long mapped to the PCMCIA slot I/O * PLX9052 registers, and one that's 0x40 long mapped to the PCMCIA
address space. * slot I/O address space.
*
- One PCI memory address space, mapped to the PCMCIA memory space * - One PCI memory address space, mapped to the PCMCIA memory space
(containing the CIS). * (containing the CIS).
*
After identifying the I/O and memory space, you can read through the * After identifying the I/O and memory space, you can read through
memory space to confirm the CIS's device ID or manufacturer ID to make * the memory space to confirm the CIS's device ID or manufacturer ID
sure it's the expected card. Keep in mind that the PCMCIA spec specifies * to make sure it's the expected card. qKeep in mind that the PCMCIA
the CIS as the lower 8 bits of each word read from the CIS, so to read the * spec specifies the CIS as the lower 8 bits of each word read from
bytes of the CIS, read every other byte (0,2,4,...). Passing that test, * the CIS, so to read the bytes of the CIS, read every other byte
you need to enable the I/O address space on the PCMCIA card via the PCMCIA * (0,2,4,...). Passing that test, you need to enable the I/O address
COR register. This is the first byte following the CIS. In my case * space on the PCMCIA card via the PCMCIA COR register. This is the
(which may not have any relation to what's on the PRISM2 cards), COR was * first byte following the CIS. In my case (which may not have any
at offset 0x800 within the PCI memory space. Write 0x41 to the COR * relation to what's on the PRISM2 cards), COR was at offset 0x800
register to enable I/O mode and to select level triggered interrupts. To * within the PCI memory space. Write 0x41 to the COR register to
confirm you actually succeeded, read the COR register back and make sure * enable I/O mode and to select level triggered interrupts. To
it actually got set to 0x41, incase you have an unexpected card inserted. * confirm you actually succeeded, read the COR register back and make
* sure it actually got set to 0x41, incase you have an unexpected
Following that, you can treat the second PCI I/O address space (the one * card inserted.
that's not 0x80 in length) as the PCMCIA I/O space. *
* Following that, you can treat the second PCI I/O address space (the
Note that in the Eumitcom's source for their drivers, they register the * one that's not 0x80 in length) as the PCMCIA I/O space.
interrupt as edge triggered when registering it with the Windows kernel. I *
don't recall how to register edge triggered on Linux (if it can be done at * Note that in the Eumitcom's source for their drivers, they register
all). But in some experimentation, I don't see much operational * the interrupt as edge triggered when registering it with the
difference between using either interrupt mode. Don't mess with the * Windows kernel. I don't recall how to register edge triggered on
interrupt mode in the COR register though, as the PLX9052 wants level * Linux (if it can be done at all). But in some experimentation, I
triggers with the way the serial EEPROM configures it on the WL11000. * don't see much operational difference between using either
* interrupt mode. Don't mess with the interrupt mode in the COR
There's some other little quirks related to timing that I bumped into, but * register though, as the PLX9052 wants level triggers with the way
I don't recall right now. Also, there's two variants of the WL11000 I've * the serial EEPROM configures it on the WL11000.
seen, revision A1 and T2. These seem to differ slightly in the timings *
configured in the wait-state generator in the PLX9052. There have also * There's some other little quirks related to timing that I bumped
been some comments from Eumitcom that cards shouldn't be hot swapped, * into, but I don't recall right now. Also, there's two variants of
apparently due to risk of cooking the PLX9052. I'm unsure why they * the WL11000 I've seen, revision A1 and T2. These seem to differ
believe this, as I can't see anything in the design that would really * slightly in the timings configured in the wait-state generator in
cause a problem, except for crashing drivers not written to expect it. And * the PLX9052. There have also been some comments from Eumitcom that
having developed drivers for the WL11000, I'd say it's quite tricky to * cards shouldn't be hot swapped, apparently due to risk of cooking
write code that will successfully deal with a hot unplug. Very odd things * the PLX9052. I'm unsure why they believe this, as I can't see
happen on the I/O side of things. But anyway, be warned. Despite that, * anything in the design that would really cause a problem, except
I've hot-swapped a number of times during debugging and driver development * for crashing drivers not written to expect it. And having developed
for various reasons (stuck WAIT# line after the radio card's firmware * drivers for the WL11000, I'd say it's quite tricky to write code
locks up). * that will successfully deal with a hot unplug. Very odd things
* happen on the I/O side of things. But anyway, be warned. Despite
Hope this is enough info for someone to add PLX9052 support to the wlan-ng * that, I've hot-swapped a number of times during debugging and
card. In the case of the WL11000, the PCI ID's are 0x1639/0x0200, with * driver development for various reasons (stuck WAIT# line after the
matching subsystem ID's. Other PLX9052-based manufacturers other than * radio card's firmware locks up).
Eumitcom (or on cards other than the WL11000) may have different PCI ID's. *
* Hope this is enough info for someone to add PLX9052 support to the
If anyone needs any more specific info, let me know. I haven't had time * wlan-ng card. In the case of the WL11000, the PCI ID's are
to implement support myself yet, and with the way things are going, might * 0x1639/0x0200, with matching subsystem ID's. Other PLX9052-based
not have time for a while.. * manufacturers other than Eumitcom (or on cards other than the
* WL11000) may have different PCI ID's.
---end of mail--- *
*/ * If anyone needs any more specific info, let me know. I haven't had
* time to implement support myself yet, and with the way things are
* going, might not have time for a while..
*/
#include <linux/config.h> #include <linux/config.h>
...@@ -134,10 +137,10 @@ not have time for a while.. ...@@ -134,10 +137,10 @@ not have time for a while..
static char dev_info[] = "orinoco_plx"; static char dev_info[] = "orinoco_plx";
#define COR_OFFSET (0x3e0 / 2) /* COR attribute offset of Prism2 PC card */ #define COR_OFFSET (0x3e0/2) /* COR attribute offset of Prism2 PC card */
#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */ #define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
#define PLX_INTCSR 0x4c /* Interrupt Control and Status Register */ #define PLX_INTCSR 0x4c /* Interrupt Control & Status Register */
#define PLX_INTCSR_INTEN (1<<6) /* Interrupt Enable bit */ #define PLX_INTCSR_INTEN (1<<6) /* Interrupt Enable bit */
static const u16 cis_magic[] = { static const u16 cis_magic[] = {
...@@ -223,6 +226,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, ...@@ -223,6 +226,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
goto fail; goto fail;
} }
/* Allocate network device */
dev = alloc_orinocodev(0, NULL); dev = alloc_orinocodev(0, NULL);
if (! dev) { if (! dev) {
err = -ENOMEM; err = -ENOMEM;
...@@ -234,15 +238,16 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, ...@@ -234,15 +238,16 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
printk(KERN_DEBUG printk(KERN_DEBUG "Detected Orinoco/Prism2 PLX device "
"Detected Orinoco/Prism2 PLX device at %s irq:%d, io addr:0x%lx\n", "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq,
pci_name(pdev), pdev->irq, pccard_ioaddr); pccard_ioaddr);
hermes_struct_init(&(priv->hw), dev->base_addr, hermes_struct_init(&(priv->hw), dev->base_addr, HERMES_IO,
HERMES_IO, HERMES_16BIT_REGSPACING); HERMES_16BIT_REGSPACING);
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
dev->name, dev);
if (err) { if (err) {
printk(KERN_ERR "orinoco_plx: Error allocating IRQ %d.\n", pdev->irq); printk(KERN_ERR "orinoco_plx: Error allocating IRQ %d.\n", pdev->irq);
err = -EBUSY; err = -EBUSY;
...@@ -254,7 +259,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, ...@@ -254,7 +259,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
if (err) if (err)
goto fail; goto fail;
return 0; /* succeeded */ return 0;
fail: fail:
printk(KERN_DEBUG "orinoco_plx: init_one(), FAIL!\n"); printk(KERN_DEBUG "orinoco_plx: init_one(), FAIL!\n");
...@@ -305,7 +310,7 @@ static struct pci_device_id orinoco_plx_pci_id_table[] = { ...@@ -305,7 +310,7 @@ static struct pci_device_id orinoco_plx_pci_id_table[] = {
{0x15e8, 0x0130, PCI_ANY_ID, PCI_ANY_ID,}, /* Correga - does this work? */ {0x15e8, 0x0130, PCI_ANY_ID, PCI_ANY_ID,}, /* Correga - does this work? */
{0x1638, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* SMC EZConnect SMC2602W, {0x1638, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* SMC EZConnect SMC2602W,
Eumitcom PCI WL11000, Eumitcom PCI WL11000,
Addtron AWA-100*/ Addtron AWA-100 */
{0x16ab, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* Global Sun Tech GL24110P */ {0x16ab, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* Global Sun Tech GL24110P */
{0x16ab, 0x1101, PCI_ANY_ID, PCI_ANY_ID,}, /* Reported working, but unknown */ {0x16ab, 0x1101, PCI_ANY_ID, PCI_ANY_ID,}, /* Reported working, but unknown */
{0x16ab, 0x1102, PCI_ANY_ID, PCI_ANY_ID,}, /* Linksys WDT11 */ {0x16ab, 0x1102, PCI_ANY_ID, PCI_ANY_ID,}, /* Linksys WDT11 */
......
...@@ -78,8 +78,7 @@ ...@@ -78,8 +78,7 @@
static char dev_info[] = "orinoco_tmd"; static char dev_info[] = "orinoco_tmd";
#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA | COR_FUNC_ENA) /* Enable PC card with level triggered irqs and irq requests */ #define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
static int orinoco_tmd_init_one(struct pci_dev *pdev, static int orinoco_tmd_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
...@@ -115,6 +114,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, ...@@ -115,6 +114,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
goto fail; goto fail;
} }
/* Allocate network device */
dev = alloc_orinocodev(0, NULL); dev = alloc_orinocodev(0, NULL);
if (! dev) { if (! dev) {
err = -ENOMEM; err = -ENOMEM;
...@@ -126,16 +126,16 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, ...@@ -126,16 +126,16 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
printk(KERN_DEBUG printk(KERN_DEBUG "Detected Orinoco/Prism2 TMD device "
"Detected Orinoco/Prism2 TMD device at %s irq:%d, io addr:0x%lx\n", "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq,
pci_name(pdev), pdev->irq, pccard_ioaddr); pccard_ioaddr);
hermes_struct_init(&(priv->hw), dev->base_addr, hermes_struct_init(&(priv->hw), dev->base_addr,
HERMES_IO, HERMES_16BIT_REGSPACING); HERMES_IO, HERMES_16BIT_REGSPACING);
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
dev); dev->name, dev);
if (err) { if (err) {
printk(KERN_ERR "orinoco_tmd: Error allocating IRQ %d.\n", printk(KERN_ERR "orinoco_tmd: Error allocating IRQ %d.\n",
pdev->irq); pdev->irq);
...@@ -148,7 +148,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, ...@@ -148,7 +148,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
if (err) if (err)
goto fail; goto fail;
return 0; /* succeeded */ return 0;
fail: fail:
printk(KERN_DEBUG "orinoco_tmd: init_one(), FAIL!\n"); printk(KERN_DEBUG "orinoco_tmd: init_one(), FAIL!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment