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)
return -EIO;
}
return 0;
}
......
......@@ -124,22 +124,22 @@
/*
* Command codes
*/
/*--- Controller Commands --------------------------*/
/*--- Controller Commands ----------------------------*/
#define HERMES_CMD_INIT (0x0000)
#define HERMES_CMD_ENABLE (0x0001)
#define HERMES_CMD_DISABLE (0x0002)
#define HERMES_CMD_DIAG (0x0003)
/*--- Buffer Mgmt Commands --------------------------*/
/*--- Buffer Mgmt Commands ---------------------------*/
#define HERMES_CMD_ALLOC (0x000A)
#define HERMES_CMD_TX (0x000B)
#define HERMES_CMD_CLRPRST (0x0012)
/*--- Regulate Commands --------------------------*/
/*--- Regulate Commands ------------------------------*/
#define HERMES_CMD_NOTIFY (0x0010)
#define HERMES_CMD_INQUIRE (0x0011)
/*--- Configure Commands --------------------------*/
/*--- Configure Commands -----------------------------*/
#define HERMES_CMD_ACCESS (0x0021)
#define HERMES_CMD_DOWNLD (0x0022)
......@@ -312,9 +312,11 @@ typedef struct hermes {
#define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val))
/* 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_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_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len,
......
......@@ -4,21 +4,21 @@
/*
* Configuration RIDs
*/
#define HERMES_RID_CNFPORTTYPE 0xFC00 /* used */
#define HERMES_RID_CNFOWNMACADDR 0xFC01 /* used */
#define HERMES_RID_CNFDESIREDSSID 0xFC02 /* used */
#define HERMES_RID_CNFOWNCHANNEL 0xFC03 /* used */
#define HERMES_RID_CNFOWNSSID 0xFC04 /* used */
#define HERMES_RID_CNFPORTTYPE 0xFC00
#define HERMES_RID_CNFOWNMACADDR 0xFC01
#define HERMES_RID_CNFDESIREDSSID 0xFC02
#define HERMES_RID_CNFOWNCHANNEL 0xFC03
#define HERMES_RID_CNFOWNSSID 0xFC04
#define HERMES_RID_CNFOWNATIMWINDOW 0xFC05
#define HERMES_RID_CNFSYSTEMSCALE 0xFC06 /* used */
#define HERMES_RID_CNFSYSTEMSCALE 0xFC06
#define HERMES_RID_CNFMAXDATALEN 0xFC07
#define HERMES_RID_CNFWDSADDRESS 0xFC08
#define HERMES_RID_CNFPMENABLED 0xFC09 /* used */
#define HERMES_RID_CNFPMENABLED 0xFC09
#define HERMES_RID_CNFPMEPS 0xFC0A
#define HERMES_RID_CNFMULTICASTRECEIVE 0xFC0B /* used */
#define HERMES_RID_CNFMAXSLEEPDURATION 0xFC0C /* used */
#define HERMES_RID_CNFPMHOLDOVERDURATION 0xFC0D /* used */
#define HERMES_RID_CNFOWNNAME 0xFC0E /* used */
#define HERMES_RID_CNFMULTICASTRECEIVE 0xFC0B
#define HERMES_RID_CNFMAXSLEEPDURATION 0xFC0C
#define HERMES_RID_CNFPMHOLDOVERDURATION 0xFC0D
#define HERMES_RID_CNFOWNNAME 0xFC0E
#define HERMES_RID_CNFOWNDTIMPERIOD 0xFC10
#define HERMES_RID_CNFWDSADDRESS1 0xFC11
#define HERMES_RID_CNFWDSADDRESS2 0xFC12
......@@ -27,17 +27,17 @@
#define HERMES_RID_CNFWDSADDRESS5 0xFC15
#define HERMES_RID_CNFWDSADDRESS6 0xFC16
#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_CNFWEPDEFAULTKEYID 0xFC23 /* used */
#define HERMES_RID_CNFDEFAULTKEY0 0xFC24 /* used */
#define HERMES_RID_CNFDEFAULTKEY1 0xFC25 /* used */
#define HERMES_RID_CNFMWOROBUST_AGERE 0xFC25 /* used */
#define HERMES_RID_CNFDEFAULTKEY2 0xFC26 /* used */
#define HERMES_RID_CNFDEFAULTKEY3 0xFC27 /* used */
#define HERMES_RID_CNFWEPFLAGS_INTERSIL 0xFC28 /* used */
#define HERMES_RID_CNFWEPDEFAULTKEYID 0xFC23
#define HERMES_RID_CNFDEFAULTKEY0 0xFC24
#define HERMES_RID_CNFDEFAULTKEY1 0xFC25
#define HERMES_RID_CNFMWOROBUST_AGERE 0xFC25
#define HERMES_RID_CNFDEFAULTKEY2 0xFC26
#define HERMES_RID_CNFDEFAULTKEY3 0xFC27
#define HERMES_RID_CNFWEPFLAGS_INTERSIL 0xFC28
#define HERMES_RID_CNFWEPKEYMAPPINGTABLE 0xFC29
#define HERMES_RID_CNFAUTHENTICATION 0xFC2A /* used */
#define HERMES_RID_CNFAUTHENTICATION 0xFC2A
#define HERMES_RID_CNFMAXASSOCSTA 0xFC2B
#define HERMES_RID_CNFKEYLENGTH_SYMBOL 0xFC2B
#define HERMES_RID_CNFTXCONTROL 0xFC2C
......@@ -53,14 +53,14 @@
#define HERMES_RID_CNFTIMCTRL 0xFC40
#define HERMES_RID_CNFTHIRTY2TALLY 0xFC42
#define HERMES_RID_CNFENHSECURITY 0xFC43
#define HERMES_RID_CNFGROUPADDRESSES 0xFC80 /* used */
#define HERMES_RID_CNFCREATEIBSS 0xFC81 /* used */
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD 0xFC82 /* used */
#define HERMES_RID_CNFRTSTHRESHOLD 0xFC83 /* used */
#define HERMES_RID_CNFTXRATECONTROL 0xFC84 /* used */
#define HERMES_RID_CNFPROMISCUOUSMODE 0xFC85 /* used */
#define HERMES_RID_CNFGROUPADDRESSES 0xFC80
#define HERMES_RID_CNFCREATEIBSS 0xFC81
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD 0xFC82
#define HERMES_RID_CNFRTSTHRESHOLD 0xFC83
#define HERMES_RID_CNFTXRATECONTROL 0xFC84
#define HERMES_RID_CNFPROMISCUOUSMODE 0xFC85
#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_CNFFRAGMENTATIONTHRESHOLD1 0xFC91
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD2 0xFC92
......@@ -76,13 +76,13 @@
#define HERMES_RID_CNFRTSTHRESHOLD5 0xFC9C
#define HERMES_RID_CNFRTSTHRESHOLD6 0xFC9D
#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_CNFTXKEY_AGERE 0xFCB1 /* used */
#define HERMES_RID_CNFTXKEY_AGERE 0xFCB1
#define HERMES_RID_CNFAUTHENTICATIONRSPTO 0xFCB2
#define HERMES_RID_CNFBASICRATES 0xFCB3
#define HERMES_RID_CNFSUPPORTEDRATES 0xFCB4
#define HERMES_RID_CNFTICKTIME 0xFCE0 /* used */
#define HERMES_RID_CNFTICKTIME 0xFCE0
#define HERMES_RID_CNFSCANREQUEST 0xFCE1
#define HERMES_RID_CNFJOINREQUEST 0xFCE2
#define HERMES_RID_CNFAUTHENTICATESTATION 0xFCE3
......@@ -100,26 +100,26 @@
#define HERMES_RID_NICID 0xFD0B
#define HERMES_RID_MFISUPRANGE 0xFD0C
#define HERMES_RID_CFISUPRANGE 0xFD0D
#define HERMES_RID_CHANNELLIST 0xFD10 /* used */
#define HERMES_RID_CHANNELLIST 0xFD10
#define HERMES_RID_REGULATORYDOMAINS 0xFD11
#define HERMES_RID_TEMPTYPE 0xFD12
#define HERMES_RID_CIS 0xFD13
#define HERMES_RID_STAID 0xFD20 /* used */
#define HERMES_RID_STAID 0xFD20
#define HERMES_RID_STASUPRANGE 0xFD21
#define HERMES_RID_MFIACTRANGES 0xFD22
#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_CURRENTSSID 0xFD41 /* used */
#define HERMES_RID_CURRENTBSSID 0xFD42 /* used */
#define HERMES_RID_COMMSQUALITY 0xFD43 /* used */
#define HERMES_RID_CURRENTTXRATE 0xFD44 /* used */
#define HERMES_RID_CURRENTSSID 0xFD41
#define HERMES_RID_CURRENTBSSID 0xFD42
#define HERMES_RID_COMMSQUALITY 0xFD43
#define HERMES_RID_CURRENTTXRATE 0xFD44
#define HERMES_RID_CURRENTBEACONINTERVAL 0xFD45
#define HERMES_RID_CURRENTSCALETHRESHOLDS 0xFD46
#define HERMES_RID_PROTOCOLRSPTIME 0xFD47
#define HERMES_RID_SHORTRETRYLIMIT 0xFD48 /* used */
#define HERMES_RID_LONGRETRYLIMIT 0xFD49 /* used */
#define HERMES_RID_MAXTRANSMITLIFETIME 0xFD4A /* used */
#define HERMES_RID_SHORTRETRYLIMIT 0xFD48
#define HERMES_RID_LONGRETRYLIMIT 0xFD49
#define HERMES_RID_MAXTRANSMITLIFETIME 0xFD4A
#define HERMES_RID_MAXRECEIVELIFETIME 0xFD4B
#define HERMES_RID_CFPOLLABLE 0xFD4C
#define HERMES_RID_AUTHENTICATIONALGORITHMS 0xFD4D
......@@ -133,10 +133,10 @@
#define HERMES_RID_OWNMACADDR 0xFD86
#define HERMES_RID_SCANRESULTSTABLE 0xFD88
#define HERMES_RID_PHYTYPE 0xFDC0
#define HERMES_RID_CURRENTCHANNEL 0xFDC1 /* used */
#define HERMES_RID_CURRENTCHANNEL 0xFDC1
#define HERMES_RID_CURRENTPOWERSTATE 0xFDC2
#define HERMES_RID_CCAMODE 0xFDC3
#define HERMES_RID_SUPPORTEDDATARATES 0xFDC6 /* used */
#define HERMES_RID_SUPPORTEDDATARATES 0xFDC6
#define HERMES_RID_BUILDSEQ 0xFFFE
#define HERMES_RID_FWID 0xFFFF
......
......@@ -76,4 +76,3 @@ struct ieee802_11_hdr {
#define IEEE802_11_SCTL_SEQ 0xFFF0
#endif /* _IEEE802_11_H */
This diff is collapsed.
......@@ -12,6 +12,7 @@
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <linux/version.h>
#include "hermes.h"
/* To enable debug messages */
......@@ -50,7 +51,6 @@ struct orinoco_private {
hermes_t hw;
u16 txfid;
/* Capabilities of the hardware/firmware */
int firmware_type;
#define FIRMWARE_TYPE_AGERE 1
......@@ -100,6 +100,10 @@ extern int orinoco_debug;
#define TRACE_ENTER(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,
int (*hard_reset)(struct orinoco_private *));
extern int __orinoco_up(struct net_device *dev);
......
......@@ -219,8 +219,7 @@ orinoco_cs_attach(void)
* are freed. Otherwise, the structures will be freed when the device
* is released.
*/
static void
orinoco_cs_detach(dev_link_t * link)
static void orinoco_cs_detach(dev_link_t *link)
{
dev_link_t **linkp;
struct net_device *dev = link->priv;
......@@ -258,8 +257,9 @@ orinoco_cs_detach(dev_link_t * link)
* device available to the system.
*/
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
#define CS_CHECK(fn, ret) do { \
last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
} while (0)
static void
orinoco_cs_config(dev_link_t *link)
......@@ -297,7 +297,8 @@ orinoco_cs_config(dev_link_t *link)
link->state |= DEV_CONFIG;
/* 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;
/*
......@@ -401,8 +402,9 @@ orinoco_cs_config(dev_link_t *link)
pcmcia_release_io(link->handle, &link->io);
last_ret = pcmcia_get_next_tuple(handle, &tuple);
if (last_ret == CS_NO_MORE_ITEMS) {
printk(KERN_ERR "GetNextTuple(). No matching CIS configuration, "
"maybe you need the ignore_cis_vcc=1 parameter.\n");
printk(KERN_ERR "GetNextTuple(). No matching "
"CIS configuration, maybe you need the "
"ignore_cis_vcc=1 parameter.\n");
goto cs_failed;
}
}
......@@ -440,7 +442,8 @@ orinoco_cs_config(dev_link_t *link)
* the I/O windows and the interrupt mapping, and putting the
* 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 */
dev->base_addr = link->io.BasePort1;
......@@ -659,4 +662,3 @@ exit_orinoco_cs(void)
module_init(init_orinoco_cs);
module_exit(exit_orinoco_cs);
......@@ -206,18 +206,17 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
if (! pci_iorange)
goto fail;
/* Usual setup of structures */
/* Allocate network device */
dev = alloc_orinocodev(0, NULL);
if (! dev) {
err = -ENOMEM;
goto fail;
}
priv = netdev_priv(dev);
priv = netdev_priv(dev);
dev->base_addr = (unsigned long) pci_ioaddr;
dev->mem_start = pci_iorange;
dev->mem_end = pci_iorange + pci_iolen - 1;
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
......@@ -238,6 +237,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
goto fail;
}
dev->irq = pdev->irq;
/* Perform a COR reset to start the card */
if(orinoco_pci_cor_reset(priv) != 0) {
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,
goto fail;
}
return 0; /* succeeded */
return 0;
fail:
if (dev) {
if (dev->irq)
......@@ -279,7 +280,7 @@ static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
unregister_netdev(dev);
if (dev->irq)
if (dev->irq)
free_irq(dev->irq, dev);
if (priv->hw.iobase)
......@@ -357,7 +358,9 @@ static int orinoco_pci_resume(struct pci_dev *pdev)
}
static struct pci_device_id orinoco_pci_pci_id_table[] = {
/* Intersil Prism 3 */
{0x1260, 0x3872, PCI_ANY_ID, PCI_ANY_ID,},
/* Intersil Prism 2.5 */
{0x1260, 0x3873, PCI_ANY_ID, PCI_ANY_ID,},
{0,},
};
......
This diff is collapsed.
......@@ -78,8 +78,7 @@
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,
const struct pci_device_id *ent)
......@@ -115,6 +114,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
goto fail;
}
/* Allocate network device */
dev = alloc_orinocodev(0, NULL);
if (! dev) {
err = -ENOMEM;
......@@ -126,16 +126,16 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
printk(KERN_DEBUG
"Detected Orinoco/Prism2 TMD device at %s irq:%d, io addr:0x%lx\n",
pci_name(pdev), pdev->irq, pccard_ioaddr);
printk(KERN_DEBUG "Detected Orinoco/Prism2 TMD device "
"at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq,
pccard_ioaddr);
hermes_struct_init(&(priv->hw), dev->base_addr,
HERMES_IO, HERMES_16BIT_REGSPACING);
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) {
printk(KERN_ERR "orinoco_tmd: Error allocating IRQ %d.\n",
pdev->irq);
......@@ -148,9 +148,9 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
if (err)
goto fail;
return 0; /* succeeded */
return 0;
fail:
fail:
printk(KERN_DEBUG "orinoco_tmd: init_one(), FAIL!\n");
if (dev) {
......
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