orinoco: reorganisation
cover orinoco: reorganisation
This patch series reorganises the orinoco driver. The focus is on splitting up the monolithic orinoco.c to make future changes easier.
The series has been through two RFCs on the orinoco-devel list. As a result, checkpatch fixes prefix the core changes, and the last two patches stop building hermes and hermes_dld as modules.
Because of patch conflicts, I've included Andrey's checkpatch cleanup patch. However there is still a conflict with Harvey Harrison's "wireless: replace use of __constant_{endian}" patch.
Regards,
Dave.
---
Andrey Borzenkov (1):
orinoco: checkpatch cleanup
David Kilroy (16):
orinoco: address leading and trailing whitespace
orinoco: spaces in parenthesised expressions
orinoco: remove unnecessary braces
orinoco: keep line length below 80 characters
orinoco: Fix interesting checkpatch errors
orinoco: Rename orinoco.c
orinoco: use orinoco_private instead of net_device in scan helper
orinoco: Move scan helpers to a separate file
orinoco: Move MIC helpers into new file
orinoco: Move firmware handling into a separate file
orinoco: Use accessor functions for bitrate tables
orinoco: Add hardware function to set multicast mode
orinoco: Move hardware functions into separate file
orinoco: Move WEXT handlers into a separate file
orinoco: hermes_dld does not need to be a module
orinoco: hermes doesn't need to be a separate module
drivers/net/wireless/orinoco/Makefile | 3 +- drivers/net/wireless/orinoco/airport.c | 37 +- drivers/net/wireless/orinoco/fw.c | 340 ++ drivers/net/wireless/orinoco/fw.h | 16 + drivers/net/wireless/orinoco/hermes.c | 120 +- drivers/net/wireless/orinoco/hermes.h | 35 +- drivers/net/wireless/orinoco/hermes_dld.c | 33 +- drivers/net/wireless/orinoco/hw.c | 586 +++ drivers/net/wireless/orinoco/hw.h | 47 + drivers/net/wireless/orinoco/main.c | 2654 +++++++++++ drivers/net/wireless/orinoco/main.h | 63 + drivers/net/wireless/orinoco/mic.c | 79 + drivers/net/wireless/orinoco/mic.h | 22 + drivers/net/wireless/orinoco/orinoco.c | 6153 ------------------------- drivers/net/wireless/orinoco/orinoco.h | 17 +- drivers/net/wireless/orinoco/orinoco_cs.c | 34 +- drivers/net/wireless/orinoco/orinoco_nortel.c | 7 +- drivers/net/wireless/orinoco/orinoco_pci.c | 5 +- drivers/net/wireless/orinoco/orinoco_pci.h | 12 +- drivers/net/wireless/orinoco/orinoco_plx.c | 3 +- drivers/net/wireless/orinoco/orinoco_tmd.c | 4 +- drivers/net/wireless/orinoco/scan.c | 233 + drivers/net/wireless/orinoco/scan.h | 29 + drivers/net/wireless/orinoco/spectrum_cs.c | 19 +- drivers/net/wireless/orinoco/wext.c | 2325 ++++++++++ drivers/net/wireless/orinoco/wext.h | 13 + 26 files changed, 6562 insertions(+), 6327 deletions(-) create mode 100644 drivers/net/wireless/orinoco/fw.c create mode 100644 drivers/net/wireless/orinoco/fw.h create mode 100644 drivers/net/wireless/orinoco/hw.c create mode 100644 drivers/net/wireless/orinoco/hw.h create mode 100644 drivers/net/wireless/orinoco/main.c create mode 100644 drivers/net/wireless/orinoco/main.h create mode 100644 drivers/net/wireless/orinoco/mic.c create mode 100644 drivers/net/wireless/orinoco/mic.h delete mode 100644 drivers/net/wireless/orinoco/orinoco.c create mode 100644 drivers/net/wireless/orinoco/scan.c create mode 100644 drivers/net/wireless/orinoco/scan.h create mode 100644 drivers/net/wireless/orinoco/wext.c create mode 100644 drivers/net/wireless/orinoco/wext.h
PATCH 1/17 orinoco: checkpatch cleanup
From: Andrey Borzenkov <[email protected]>
Fix errors and obvious warnings reported by checkpatch in all files except orinoco.c.
--- drivers/net/wireless/orinoco/airport.c | 35 +++++---- drivers/net/wireless/orinoco/hermes.c | 106 ++++++++++++++----------- drivers/net/wireless/orinoco/hermes.h | 35 +++++---- drivers/net/wireless/orinoco/orinoco.h | 17 +++-- drivers/net/wireless/orinoco/orinoco_cs.c | 32 ++++--- drivers/net/wireless/orinoco/orinoco_nortel.c | 7 +- drivers/net/wireless/orinoco/orinoco_pci.c | 5 +- drivers/net/wireless/orinoco/orinoco_pci.h | 10 +- drivers/net/wireless/orinoco/orinoco_plx.c | 3 +- drivers/net/wireless/orinoco/orinoco_tmd.c | 2 +- drivers/net/wireless/orinoco/spectrum_cs.c | 15 ++-- 11 files changed, 147 insertions(+), 120 deletions(-)
drivers/net/wireless/orinoco/airport.c +20 -15
@@ -4,9 +4,9 @@* card. * * Copyright notice & release notes in file orinoco.c -* +* * Note specific to airport stub: -* +* * 0.05 : first version of the new split driver * 0.06 : fix possible hang on powerup, add sleep support */
@@ -60,7 +60,8 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state)orinoco_unlock (priv, &flags);disable_irq (dev->irq); -pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE ,macio_get_of_node (mdev),0 ,0 ); +pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE , +macio_get_of_node (mdev),0 ,0 );return 0 ; }
@@ -75,7 +76,8 @@ airport_resume(struct macio_dev *mdev)printk (KERN_DEBUG "%s: Airport waking up\n" , dev->name); -pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE ,macio_get_of_node (mdev),0 ,1 ); +pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE , +macio_get_of_node (mdev),0 ,1 );msleep (200 );enable_irq (dev->irq);
@@ -93,7 +95,7 @@ airport_resume(struct macio_dev *mdev) priv->hw_unavailable--; -if (priv->open && (! priv->hw_unavailable)) { +if (priv->open && (!priv->hw_unavailable)) { err =__orinoco_up (dev);if (err) printk(KERN_ERR "%s: Error %d restarting card on PBOOK_WAKE\n",
@@ -127,7 +129,8 @@ airport_detach(struct macio_dev *mdev)macio_release_resource (mdev,0 ); -pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE ,macio_get_of_node (mdev),0 ,0 ); +pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE , +macio_get_of_node (mdev),0 ,0 );ssleep (1 );macio_set_drvdata (mdev,NULL );
@@ -153,9 +156,11 @@ static int airport_hard_reset(struct orinoco_private *priv)* off. */ disable_irq (dev->irq); -pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE ,macio_get_of_node (card->mdev),0 ,0 ); +pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE , +macio_get_of_node (card->mdev),0 ,0 );ssleep (1 ); -pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE ,macio_get_of_node (card->mdev),0 ,1 ); +pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE , +macio_get_of_node (card->mdev),0 ,1 );ssleep (1 );enable_irq (dev->irq);
@@ -182,7 +187,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)/* Allocate space for private device-specific data */ dev =alloc_orinocodev (sizeof (*card), &mdev->ofdev.dev, airport_hard_reset,NULL ); -if (! dev) { +if (!dev) { printk(KERN_ERR PFX "Cannot allocate network device\n");return -ENODEV ; }
@@ -214,9 +219,10 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match) }hermes_struct_init (hw, card->vaddr,HERMES_16BIT_REGSPACING ); - +/* Power up card */ -pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE ,macio_get_of_node (mdev),0 ,1 ); +pmac_call_feature (PMAC_FTR_AIRPORT_ENABLE , +macio_get_of_node (mdev),0 ,1 );ssleep (1 );/* Reset it before we get the interrupt */
@@ -248,7 +254,7 @@ MODULE_AUTHOR("Benjamin Herrenschmidt <[email protected]>");MODULE_DESCRIPTION ("Driver for the Apple Airport wireless card." );MODULE_LICENSE ("Dual MPL/GPL" ); -static struct of_device_id airport_match[] = +static struct of_device_id airport_match[] = { { .name ="radio" ,
@@ -256,10 +262,9 @@ static struct of_device_id airport_match[] = {}, }; -MODULE_DEVICE_TABLE (of, airport_match); +MODULE_DEVICE_TABLE (of, airport_match); -static struct macio_driver airport_driver = -{ +static struct macio_driver airport_driver = { .name =DRIVER_NAME , .match_table = airport_match, .probe = airport_attach,
drivers/net/wireless/orinoco/hermes.c +59 -47
292 lines not on this page · raw message
drivers/net/wireless/orinoco/hermes.h +20 -15
@@ -15,7 +15,8 @@* Copyright (C) 2000, David Gibson, Linuxcare Australia. * (C) Copyright David Gibson, IBM Corp. 2001-2003. * -* Portions taken from hfa384x.h, Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. +* Portions taken from hfa384x.h. +* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. * * This file distributed under the GPL, version 2. */
@@ -31,7 +32,7 @@*/ #include <linux/if_ether.h> -#include <asm/io.h> +#include <linux/io.h> /* * Limits and constants
@@ -203,7 +204,7 @@ struct hermes_tx_descriptor {__le32 sw_support;u8 retry_count;u8 tx_rate; -__le16 tx_control; +__le16 tx_control; } __attribute__ ((packed));#define HERMES_TXSTAT_RETRYERR (0x0001)
@@ -298,7 +299,7 @@ struct symbol_scan_apinfo {/* bits: 0-ess, 1-ibss, 4-privacy [wep] */ __le16 essid_len;/* ESSID length */ u8 essid[32 ];/* ESSID of the network */ -__le16 rates[5 ];/* Bit rate supported */ +__le16 rates[5 ];/* Bit rate supported */ __le16 basic_rates;/* Basic rates bitmask */ u8 unknown2[6 ];/* Always FF:FF:FF:FF:00:00 */ u8 unknown3[8 ];/* Always 0, appeared in f/w 3.91-68 */
@@ -344,14 +345,14 @@ struct agere_ext_scan_info {u8 data[316 ]; } __attribute__ ((packed)); -#define HERMES_LINKSTATUS_NOT_CONNECTED (0x0000) +#define HERMES_LINKSTATUS_NOT_CONNECTED (0x0000)#define HERMES_LINKSTATUS_CONNECTED (0x0001)#define HERMES_LINKSTATUS_DISCONNECTED (0x0002)#define HERMES_LINKSTATUS_AP_CHANGE (0x0003)#define HERMES_LINKSTATUS_AP_OUT_OF_RANGE (0x0004)#define HERMES_LINKSTATUS_AP_IN_RANGE (0x0005)#define HERMES_LINKSTATUS_ASSOC_FAILED (0x0006) - +struct hermes_linkstatus {__le16 linkstatus;/* Link status */ } __attribute__ ((packed));
@@ -384,11 +385,12 @@ typedef struct hermes {/* Register access convenience macros */ #define hermes_read_reg (hw, off) \ - (ioread16((hw)->iobase + ( (off) << (hw)->reg_spacing ))) + (ioread16((hw)->iobase + ((off) << (hw)->reg_spacing)))#define hermes_write_reg (hw, off, val) \ (iowrite16((val), (hw)->iobase + ((off) << (hw)->reg_spacing)))#define hermes_read_regn (hw, name) hermes_read_reg((hw), HERMES_##name) -#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 */ void hermes_struct_init (hermes_t *hw,void __iomem *address,int reg_spacing);
@@ -430,7 +432,7 @@ static inline int hermes_enable_port(hermes_t *hw, int port)static inline int hermes_disable_port (hermes_t *hw,int port) { -return hermes_docmd_wait (hw,HERMES_CMD_DISABLE | (port <<8 ), +return hermes_docmd_wait (hw,HERMES_CMD_DISABLE | (port <<8 ),0 ,NULL ); }
@@ -441,11 +443,12 @@ static inline int hermes_inquire(hermes_t *hw, u16 rid)return hermes_docmd_wait (hw,HERMES_CMD_INQUIRE , rid,NULL ); } -#define HERMES_BYTES_TO_RECLEN (n) ( (((n)+1)/2) + 1 ) -#define HERMES_RECLEN_TO_BYTES (n) ( ((n)-1) * 2 ) +#define HERMES_BYTES_TO_RECLEN (n) ((((n)+1)/2) + 1) +#define HERMES_RECLEN_TO_BYTES (n) (((n)-1) * 2)/* Note that for the next two, the count is in 16-bit words, not bytes */ -static inline void hermes_read_words (struct hermes *hw,int off,void *buf,unsigned count) +static inline void hermes_read_words (struct hermes *hw,int off, +void *buf,unsigned count) { off = off << hw->reg_spacing;ioread16_rep (hw->iobase + off, buf, count);
@@ -460,7 +463,8 @@ static inline void hermes_write_bytes(struct hermes *hw, int off,iowrite8 (buf[count -1 ], hw->iobase + off); } -static inline void hermes_clear_words (struct hermes *hw,int off,unsigned count) +static inline void hermes_clear_words (struct hermes *hw,int off, +unsigned count) {unsigned i;
@@ -471,9 +475,10 @@ static inline void hermes_clear_words(struct hermes *hw, int off, unsigned count }#define HERMES_READ_RECORD (hw, bap, rid, buf) \ - (hermes_read_ltv((hw),(bap),(rid), sizeof(*buf), NULL, (buf))) + (hermes_read_ltv((hw), (bap), (rid), sizeof(*buf), NULL, (buf)))#define HERMES_WRITE_RECORD (hw, bap, rid, buf) \ - (hermes_write_ltv((hw),(bap),(rid),HERMES_BYTES_TO_RECLEN(sizeof(*buf)),(buf))) + (hermes_write_ltv((hw), (bap), (rid), \ + HERMES_BYTES_TO_RECLEN(sizeof(*buf)), (buf)))static inline int hermes_read_wordrec (hermes_t *hw,int bap,u16 rid,u16 *word) {
drivers/net/wireless/orinoco/orinoco.h +10 -7
@@ -1,5 +1,5 @@/* orinoco.h -* +* * Common definitions to all pieces of the various orinoco * drivers */
@@ -18,9 +18,9 @@#include "hermes.h" /* To enable debug messages */ -//#define ORINOCO_DEBUG 3 +/*#define ORINOCO_DEBUG 3*/ -#define WIRELESS_SPY // enable iwspy support +#define WIRELESS_SPY /* enable iwspy support */ #define MAX_SCAN_LEN 4096
@@ -121,7 +121,7 @@ struct orinoco_private {u16 encode_alg, wep_restrict, tx_key;struct orinoco_key keys[ORINOCO_MAX_KEYS ];int bitratemode; -char nick[IW_ESSID_MAX_SIZE +1 ]; +char nick[IW_ESSID_MAX_SIZE +1 ];char desired_essid[IW_ESSID_MAX_SIZE +1 ];char desired_bssid[ETH_ALEN ];int bssid_fixed;
@@ -131,7 +131,7 @@ struct orinoco_private {u16 pm_on, pm_mcast, pm_period, pm_timeout;u16 preamble;#ifdef WIRELESS_SPY -struct iw_spy_data spy_data;/* iwspy support */ +struct iw_spy_data spy_data;/* iwspy support */ struct iw_public_data wireless_data;#endif
@@ -168,7 +168,10 @@ struct orinoco_private {#ifdef ORINOCO_DEBUG extern int orinoco_debug; -#define DEBUG(n, args...) do { if (orinoco_debug>(n)) printk(KERN_DEBUG args); } while(0) +#define DEBUG(n, args...) do { \ + if (orinoco_debug > (n)) \ + printk(KERN_DEBUG args); \ +} while (0)#else #define DEBUG(n, args...) do { } while (0)#endif /* ORINOCO_DEBUG */
@@ -185,7 +188,7 @@ extern void free_orinocodev(struct net_device *dev);extern int __orinoco_up (struct net_device *dev);extern int __orinoco_down (struct net_device *dev);extern int orinoco_reinit_firmware (struct net_device *dev); -extern irqreturn_t orinoco_interrupt (int irq,void * dev_id); +extern irqreturn_t orinoco_interrupt (int irq,void *dev_id);/********************************************************************/ /* Locking and synchronization functions */
drivers/net/wireless/orinoco/orinoco_cs.c +18 -14
@@ -6,7 +6,7 @@* It should also be usable on various Prism II based cards such as the * Linksys, D-Link and Farallon Skyline. It should also work on Symbol * cards such as the 3Com AirConnect and Ericsson WLAN. -* +* * Copyright notice & release notes in file orinoco.c */
@@ -30,7 +30,8 @@/********************************************************************/ MODULE_AUTHOR ("David Gibson <[email protected]>" ); -MODULE_DESCRIPTION ("Driver for PCMCIA Lucent Orinoco, Prism II based and similar wireless cards" ); +MODULE_DESCRIPTION ("Driver for PCMCIA Lucent Orinoco," +" Prism II based and similar wireless cards" );MODULE_LICENSE ("Dual MPL/GPL" );/* Module parameters */
@@ -53,8 +54,8 @@ struct orinoco_pccard {/* Used to handle hard reset */ /* yuck, we need this hack to work around the insanity of the -* PCMCIA layer */ -unsigned long hard_reset_in_progress; +* PCMCIA layer */ +unsigned long hard_reset_in_progress; };
@@ -98,7 +99,7 @@ orinoco_cs_hard_reset(struct orinoco_private *priv)* This creates an "instance" of the driver, allocating local data * structures for one device. The device is registered with Card * Services. -* +* * The dev_link structure is initialized, but we don't actually * configure the card at this point -- we wait until we receive a card * insertion event. */
@@ -111,7 +112,7 @@ orinoco_cs_probe(struct pcmcia_device *link) dev =alloc_orinocodev (sizeof (*card), &handle_to_dev (link), orinoco_cs_hard_reset,NULL ); -if (! dev) +if (!dev)return -ENOMEM ; priv =netdev_priv (dev); card = priv->card;
@@ -124,7 +125,7 @@ orinoco_cs_probe(struct pcmcia_device *link) link->irq.Attributes =IRQ_TYPE_DYNAMIC_SHARING |IRQ_HANDLE_PRESENT ; link->irq.IRQInfo1 =IRQ_LEVEL_ID ; link->irq.Handler = orinoco_interrupt; - link->irq.Instance = dev; + link->irq.Instance = dev;/* General socket configuration defaults can go here. In this * client, we assume very little, and rely on the CIS for
@@ -162,8 +163,11 @@ static void orinoco_cs_detach(struct pcmcia_device *link)*/ #define CS_CHECK (fn, ret) do { \ - last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ - } while (0) + last_fn = (fn); \ + last_ret = (ret); \ + if (last_ret != 0) \ + goto cs_failed; \ +} while (0) static int orinoco_cs_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg,
@@ -307,8 +311,8 @@ orinoco_cs_config(struct pcmcia_device *link)* initialized and arranged in a linked list at link->dev_node. */ strcpy (card->node.dev_name, dev->name); link->dev_node = &card->node;/* link->dev_node being non-NULL is also -used to indicate that the -net_device has been registered */ +* used to indicate that the +* net_device has been registered */ /* Finally, report what we've done */ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s, irq %d, io "
@@ -359,7 +363,7 @@ static int orinoco_cs_suspend(struct pcmcia_device *link)/* This is probably racy, but I can't think of a better way, short of rewriting the PCMCIA layer to not suck :-( */ -if (!test_bit (0 , &card->hard_reset_in_progress)) { +if (!test_bit (0 , &card->hard_reset_in_progress)) {spin_lock_irqsave (&priv->lock, flags); err =__orinoco_down (dev);
@@ -384,7 +388,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)int err =0 ;unsigned long flags; -if (!test_bit (0 , &card->hard_reset_in_progress)) { +if (!test_bit (0 , &card->hard_reset_in_progress)) { err =orinoco_reinit_firmware (dev);if (err) { printk(KERN_ERR "%s: Error %d re-initializing firmware\n",
@@ -397,7 +401,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)netif_device_attach (dev); priv->hw_unavailable--; -if (priv->open && ! priv->hw_unavailable) { +if (priv->open && !priv->hw_unavailable) { err =__orinoco_up (dev);if (err) printk(KERN_ERR "%s: Error %d restarting card\n",
drivers/net/wireless/orinoco/orinoco_nortel.c +3 -4
@@ -9,12 +9,12 @@* * Some of this code is borrowed from orinoco_plx.c * Copyright (C) 2001 Daniel Barlow -* Some of this code is borrowed from orinoco_pci.c +* Some of this code is borrowed from orinoco_pci.c * Copyright (C) 2001 Jean Tourrilhes * Some of this code is "inspired" by linux-wlan-ng-0.1.10, but nothing * has been copied from it. linux-wlan-ng-0.1.10 is originally : * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. -* +* * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License
@@ -103,9 +103,8 @@ static int orinoco_nortel_hw_init(struct orinoco_pci_card *card)iowrite16 (0x8 , card->bridge_io +2 );for (i =0 ; i <30 ; i++) {mdelay (30 ); -if (ioread16 (card->bridge_io) &0x10 ) { +if (ioread16 (card->bridge_io) &0x10 )break ; - } }if (i ==30 ) { printk(KERN_ERR PFX "brg1 timed out\n");
drivers/net/wireless/orinoco/orinoco_pci.c +3 -2
@@ -1,5 +1,5 @@/* orinoco_pci.c -* +* * Driver for Prism 2.5/3 devices that have a direct PCI interface * (i.e. these are not PCMCIA cards in a PCMCIA-to-PCI bridge). * The card contains only one PCI region, which contains all the usual
@@ -237,7 +237,8 @@ static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION" (Pavel Roskin <[email protected]>," " David Gibson <[email protected]> &" " Jean Tourrilhes <[email protected]>)" ; -MODULE_AUTHOR ("Pavel Roskin <[email protected]> & David Gibson <[email protected]>" ); +MODULE_AUTHOR ("Pavel Roskin <[email protected]> &" +" David Gibson <[email protected]>" );MODULE_DESCRIPTION ("Driver for wireless LAN cards using direct PCI interface" );MODULE_LICENSE ("Dual MPL/GPL" );
drivers/net/wireless/orinoco/orinoco_pci.h +5 -5
@@ -1,5 +1,5 @@/* orinoco_pci.h -* +* * Common code for all Orinoco drivers for PCI devices, including * both native PCI and PCMCIA-to-PCI bridges. *
@@ -37,11 +37,11 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state)if (err)printk (KERN_WARNING "%s: error %d bringing interface down " "for suspend\n" , dev->name, err); - +netif_device_detach (dev); priv->hw_unavailable++; - +orinoco_unlock (priv, &flags);free_irq (pdev->irq, dev);
@@ -90,13 +90,13 @@ static int orinoco_pci_resume(struct pci_dev *pdev) priv->hw_unavailable--; -if (priv->open && (! priv->hw_unavailable)) { +if (priv->open && (!priv->hw_unavailable)) { err =__orinoco_up (dev);if (err)printk (KERN_ERR "%s: Error %d restarting card on resume\n" , dev->name, err); } - +spin_unlock_irqrestore (&priv->lock, flags);return 0 ;
drivers/net/wireless/orinoco/orinoco_plx.c +1 -2
@@ -146,9 +146,8 @@ static int orinoco_plx_hw_init(struct orinoco_pci_card *card) }; printk(KERN_DEBUG PFX "CIS: "); - for (i = 0; i < 16; i++) { + for (i = 0; i < 16; i++)printk ("%02X:" ,ioread8 (card->attr_io + (i <<1 ))); - }printk ("\n" );/* Verify whether a supported PC card is present */
drivers/net/wireless/orinoco/orinoco_tmd.c +1 -1
@@ -1,7 +1,7 @@/* orinoco_tmd.c * * Driver for Prism II devices which would usually be driven by orinoco_cs, -* but are connected to the PCI bus by a TMD7160. +* but are connected to the PCI bus by a TMD7160. * * Copyright (C) 2003 Joerg Dorchain <joerg AT dorchain.net> * based heavily upon orinoco_plx.c Copyright (C) 2001 Daniel Barlow
drivers/net/wireless/orinoco/spectrum_cs.c +7 -8
@@ -133,7 +133,7 @@ spectrum_reset(struct pcmcia_device *link, int idle)udelay (1000 );return 0 ; - cs_failed: +cs_failed:cs_error (link, last_fn, last_ret);return -ENODEV ; }
@@ -171,7 +171,7 @@ spectrum_cs_stop_firmware(struct orinoco_private *priv, int idle)* This creates an "instance" of the driver, allocating local data * structures for one device. The device is registered with Card * Services. -* +* * The dev_link structure is initialized, but we don't actually * configure the card at this point -- we wait until we receive a card * insertion event. */
@@ -185,7 +185,7 @@ spectrum_cs_probe(struct pcmcia_device *link) dev =alloc_orinocodev (sizeof (*card), &handle_to_dev (link), spectrum_cs_hard_reset, spectrum_cs_stop_firmware); -if (! dev) +if (!dev)return -ENOMEM ; priv =netdev_priv (dev); card = priv->card;
@@ -198,7 +198,7 @@ spectrum_cs_probe(struct pcmcia_device *link) link->irq.Attributes =IRQ_TYPE_DYNAMIC_SHARING |IRQ_HANDLE_PRESENT ; link->irq.IRQInfo1 =IRQ_LEVEL_ID ; link->irq.Handler = orinoco_interrupt; - link->irq.Instance = dev; + link->irq.Instance = dev;/* General socket configuration defaults can go here. In this * client, we assume very little, and rely on the CIS for
@@ -367,9 +367,8 @@ spectrum_cs_config(struct pcmcia_device *link) card->node.major = card->node.minor =0 ;/* Reset card */ -if (spectrum_cs_hard_reset (priv) !=0 ) { +if (spectrum_cs_hard_reset (priv) !=0 ) goto failed; - }SET_NETDEV_DEV (dev, &handle_to_dev (link));/* Tell the stack we exist */
@@ -382,8 +381,8 @@ spectrum_cs_config(struct pcmcia_device *link)* initialized and arranged in a linked list at link->dev_node. */ strcpy (card->node.dev_name, dev->name); link->dev_node = &card->node;/* link->dev_node being non-NULL is also -used to indicate that the -net_device has been registered */ +* used to indicate that the +* net_device has been registered */ /* Finally, report what we've done */ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s, irq %d, io "
Signature · 1 line
1.6.0.6
PATCH 2/17 orinoco: address leading and trailing whitespace
Remove the following checkpatch errors from orinoco.c
ERROR: trailing whitespace
ERROR: code indent should use tabs where possible
WARNING: suspect code indent for conditional statements
--- drivers/net/wireless/orinoco/orinoco.c | 106 ++++++++++++++++---------------- 1 files changed, 53 insertions(+), 53 deletions(-)
drivers/net/wireless/orinoco/orinoco.c +53 -53
@@ -798,7 +798,7 @@ static int orinoco_stop(struct net_device *dev)static struct net_device_stats *orinoco_get_stats (struct net_device *dev) {struct orinoco_private *priv =netdev_priv (dev); - +return &priv->stats; }
@@ -914,13 +914,13 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) dev->name);return NETDEV_TX_BUSY ; } - +if (netif_queue_stopped (dev)) { -printk (KERN_DEBUG "%s: Tx while transmitter busy!\n" , +printk (KERN_DEBUG "%s: Tx while transmitter busy!\n" , dev->name);return NETDEV_TX_BUSY ; } - +if (orinoco_lock (priv, &flags) !=0 ) {printk (KERN_ERR "%s: orinoco_xmit() called while hw_unavailable\n" , dev->name);
@@ -929,8 +929,8 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)if (!netif_carrier_ok (dev) || (priv->iw_mode ==IW_MODE_MONITOR )) {/* Oops, the firmware hasn't established a connection, -silently drop the packet (this seems to be the -safest approach). */ +silently drop the packet (this seems to be the +safest approach). */ goto drop; }
@@ -1141,10 +1141,10 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw) dev->name, fid, err);return ; } - +DEBUG (1 ,"%s: Tx error, err %d (FID=%04X)\n" , dev->name, err, fid); - +/* We produce a TXDROP event only for retry or lifetime * exceeded, because that's the only status that really mean * that this particular node went away.
@@ -1334,7 +1334,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, skb->ip_summed =CHECKSUM_NONE ; skb->pkt_type =PACKET_OTHERHOST ; skb->protocol =__constant_htons (ETH_P_802_2 ); - + stats->rx_packets++; stats->rx_bytes += skb->len;
@@ -1424,8 +1424,8 @@ static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw)/* Sanity checks */ if (length <3 ) {/* No for even an 802.2 LLC header */ /* At least on Symbol firmware with PCF we get quite a -lot of these legitimately - Poll frames with no -data. */ +lot of these legitimately - Poll frames with no +data. */ goto out; }if (length >IEEE80211_MAX_DATA_LEN ) {
@@ -1444,7 +1444,7 @@ static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw)header, plus 2 bytes so we can align the IP header on a 32bit boundary, plus 1 byte so we can read in odd length packets from the card, which has an IO granularity of 16 -bits */ +bits */ skb =dev_alloc_skb (length+ETH_HLEN +2 +1 );if (!skb) { printk(KERN_WARNING "%s: Can't allocate skb for Rx\n",
@@ -1587,7 +1587,7 @@ static void orinoco_rx(struct net_device *dev, skb->ip_summed =CHECKSUM_NONE ;if (fc &IEEE80211_FCTL_TODS ) skb->pkt_type =PACKET_OTHERHOST ; - +/* Process the wireless stats if needed */ orinoco_stat_gather (dev, skb, desc);
@@ -1673,7 +1673,7 @@ static void print_linkstatus(struct net_device *dev, u16 status)default : s ="UNKNOWN" ; } - +printk (KERN_DEBUG "%s: New link status: %s (%04x)\n" , dev->name, s, status); }
@@ -2046,7 +2046,7 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) "Frame dropped.\n", dev->name, err);return ; } - + len =HERMES_RECLEN_TO_BYTES (le16_to_cpu (info.len)); type =le16_to_cpu (info.type);
@@ -2054,23 +2054,23 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)case HERMES_INQ_TALLIES : {struct hermes_tallies_frame tallies;struct iw_statistics *wstats = &priv->wstats; - +if (len >sizeof (tallies)) {printk (KERN_WARNING "%s: Tallies frame too long (%d bytes)\n" , dev->name, len); len =sizeof (tallies); } - + err =hermes_bap_pread (hw,IRQ_BAP , &tallies, len, infofid,sizeof (info));if (err)break ; - +/* Increment our various counters */ /* wstats->discard.nwid - no wrong BSSID stuff */ wstats->discard.code +=le16_to_cpu (tallies.RxWEPUndecryptable); -if (len ==sizeof (tallies)) +if (len ==sizeof (tallies)) wstats->discard.code +=le16_to_cpu (tallies.RxDiscards_WEPICVError) +le16_to_cpu (tallies.RxDiscards_WEPExcluded);
@@ -2326,7 +2326,7 @@ int __orinoco_down(struct net_device *dev)hermes_set_irqmask (hw,0 );hermes_write_regn (hw,EVACK ,0xffff ); } - +/* firmware will have to reassociate */ netif_carrier_off (dev); priv->last_linkstatus =0xffff ;
@@ -2346,7 +2346,7 @@ static int orinoco_allocate_fid(struct net_device *dev)printk (KERN_WARNING "%s: firmware ALLOC bug detected " "(old Symbol firmware?). Trying to work around... " , dev->name); - + priv->nicbuf_size =TX_NICBUF_SIZE_BUG ; err =hermes_allocate (hw, priv->nicbuf_size, &priv->txfid);if (err)
@@ -2467,7 +2467,7 @@ static int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv)/* Force uniform key length to work around firmware bugs */ keylen =le16_to_cpu (priv->keys[priv->tx_key].len); - +if (keylen >LARGE_KEY_SIZE ) {printk (KERN_ERR "%s: BUG: Key %d has oversize length %d.\n" , priv->ndev->name, priv->tx_key, keylen);
@@ -2572,7 +2572,7 @@ static int __orinoco_hw_setup_enc(struct orinoco_private *priv)HERMES_RID_CNFWEPFLAGS_INTERSIL , master_wep_flag);if (err) -return err; +return err;break ; }
@@ -2707,7 +2707,7 @@ static int __orinoco_program_rids(struct net_device *dev) }else { createibss = priv->createibss; } - + err =hermes_write_wordrec (hw,USER_BAP ,HERMES_RID_CNFCREATEIBSS , createibss);
@@ -2866,7 +2866,7 @@ static int __orinoco_program_rids(struct net_device *dev)if (priv->iw_mode ==IW_MODE_MONITOR ) {/* Enable monitor mode */ dev->type =ARPHRD_IEEE80211 ; - err =hermes_docmd_wait (hw,HERMES_CMD_TEST | + err =hermes_docmd_wait (hw,HERMES_CMD_TEST |HERMES_TEST_MONITOR ,0 ,NULL ); }else {/* Disable monitor mode */
@@ -2914,7 +2914,7 @@ __orinoco_set_multicast_list(struct net_device *dev)if (err) {printk (KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n" , dev->name, err); - }else + }else priv->promiscuous = promisc; }
@@ -2931,11 +2931,11 @@ __orinoco_set_multicast_list(struct net_device *dev)BUG_ON (! p);/* paranoia: bad address size in list? */ BUG_ON (p->dmi_addrlen !=ETH_ALEN ); - +memcpy (mclist.addr[i], p->dmi_addr,ETH_ALEN ); p = p->next; } - +if (p)printk (KERN_WARNING "%s: Multicast list is " "longer than mc_count\n" , dev->name);
@@ -2982,7 +2982,7 @@ static void orinoco_reset(struct work_struct *work)orinoco_unlock (priv, &flags); -/* Scanning support: Cleanup of driver struct */ +/* Scanning support: Cleanup of driver struct */ orinoco_clear_scan_results (priv,0 ); priv->scan_inprogress =0 ;
@@ -3070,7 +3070,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id)orinoco_unlock (priv, &flags);return IRQ_NONE ; } - +if (jiffies != last_irq_jiffy) loops_this_jiffy =0 ; last_irq_jiffy = jiffies;
@@ -3107,7 +3107,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id)__orinoco_ev_tx (dev, hw);if (events &HERMES_EV_ALLOC )__orinoco_ev_alloc (dev, hw); - +hermes_write_regn (hw,EVACK , evstat); evstat =hermes_read_regn (hw,EVSTAT );
@@ -3315,7 +3315,7 @@ static int determine_firmware(struct net_device *dev) priv->has_ibss = (firmver >=0x20000 ); priv->has_wep = (firmver >=0x15012 ); priv->has_big_wep = (firmver >=0x20000 ); - priv->has_pm = (firmver >=0x20000 && firmver <0x22000 ) || + priv->has_pm = (firmver >=0x20000 && firmver <0x22000 ) || (firmver >=0x29000 && firmver <0x30000 ) || firmver >=0x31000 ; priv->has_preamble = (firmver >=0x20000 );
@@ -3335,8 +3335,8 @@ static int determine_firmware(struct net_device *dev)*/ priv->do_fw_download = (priv->stop_fw !=NULL ); - priv->broken_disableport = (firmver ==0x25013 ) || - (firmver >=0x30000 && firmver <=0x31000 ); + priv->broken_disableport = (firmver ==0x25013 ) || + (firmver >=0x30000 && firmver <=0x31000 ); priv->has_hostscan = (firmver >=0x31001 ) || (firmver >=0x29057 && firmver <0x30000 );/* Tested with Intel firmware : 0x20015 => Jean II */
@@ -3554,7 +3554,7 @@ static int orinoco_init(struct net_device *dev)if (err) goto out; } - +/* Set up the default configuration */ priv->iw_mode =IW_MODE_INFRA ;/* By default use IEEE/IBSS ad-hoc mode if we have it */
@@ -3720,7 +3720,7 @@ static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active, rid = (priv->port_type ==3 ) ?HERMES_RID_CNFOWNSSID :HERMES_RID_CNFDESIREDSSID ; - + err =hermes_read_ltv (hw,USER_BAP , rid,sizeof (essidbuf),NULL , &essidbuf);if (err)
@@ -3744,12 +3744,12 @@ static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active, fail_unlock:orinoco_unlock (priv, &flags); -return err; +return err; }static int orinoco_hw_get_freq (struct orinoco_private *priv) { - +hermes_t *hw = &priv->hw;int err =0 ;u16 channel;
@@ -3758,7 +3758,7 @@ static int orinoco_hw_get_freq(struct orinoco_private *priv)if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; - + err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CURRENTCHANNEL , &channel);if (err) goto out;
@@ -3806,7 +3806,7 @@ static int orinoco_hw_get_bitratelist(struct orinoco_private *priv,if (err)return err; - + num =le16_to_cpu (list.len); *numrates = num; num =min (num, max);
@@ -4008,7 +4008,7 @@ static int orinoco_ioctl_getiwrange(struct net_device *dev, range->freq[k].e =1 ; k++; } - +if (k >=IW_MAX_FREQUENCIES )break ; }
@@ -4446,7 +4446,7 @@ static int orinoco_ioctl_setsens(struct net_device *dev,if ((val <1 ) || (val >3 ))return -EINVAL ; - +if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; priv->ap_density = val;
@@ -4544,7 +4544,7 @@ static int orinoco_ioctl_getfrag(struct net_device *dev,if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; - +if (priv->has_mwo) { err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFMWOROBUST_AGERE,
@@ -4567,7 +4567,7 @@ static int orinoco_ioctl_getfrag(struct net_device *dev, }orinoco_unlock (priv, &flags); - +return err; }
@@ -4581,7 +4581,7 @@ static int orinoco_ioctl_setrate(struct net_device *dev,int bitrate;/* 100s of kilobits */ int i;unsigned long flags; - +/* As the user space doesn't know our highest rate, it uses -1 * to ask us to set the highest rate. Test it using "iwconfig * ethX rate auto" - Jean II */
@@ -4603,7 +4603,7 @@ static int orinoco_ioctl_setrate(struct net_device *dev, ratemode = i;break ; } - +if (ratemode ==-1 )return -EINVAL ;
@@ -4646,7 +4646,7 @@ static int orinoco_ioctl_getrate(struct net_device *dev, HERMES_RID_CURRENTTXRATE, &val);if (err) goto out; - +switch (priv->firmware_type) {case FIRMWARE_TYPE_AGERE :/* Lucent style rate */ /* Note : in Lucent firmware, the return value of
@@ -4714,7 +4714,7 @@ static int orinoco_ioctl_setpower(struct net_device *dev, err = -EINVAL ; goto out; } - +if (prq->flags &IW_POWER_TIMEOUT ) { priv->pm_on =1 ; priv->pm_timeout = prq->value /1000 ;
@@ -4728,7 +4728,7 @@ static int orinoco_ioctl_setpower(struct net_device *dev,if (!priv->pm_on) { err = -EINVAL ; goto out; - } + } } out:
@@ -4750,7 +4750,7 @@ static int orinoco_ioctl_getpower(struct net_device *dev,if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; - + err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CNFPMENABLED , &enable);if (err) goto out;
@@ -4814,7 +4814,7 @@ static int orinoco_ioctl_set_encodeext(struct net_device *dev, idx = priv->tx_key;if (encoding->flags &IW_ENCODE_DISABLED ) - alg =IW_ENCODE_ALG_NONE ; + alg =IW_ENCODE_ALG_NONE ;if (priv->has_wpa && (alg !=IW_ENCODE_ALG_TKIP )) {/* Clear any TKIP TX key we had */
@@ -5191,7 +5191,7 @@ static int orinoco_ioctl_getretry(struct net_device *dev,if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; - + err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_SHORTRETRYLIMIT , &short_limit);if (err)
@@ -5310,7 +5310,7 @@ static int orinoco_ioctl_setport3(struct net_device *dev,break ; } priv->prefer_port3 =0 ; - +break ;case 1 :/* Try to do Lucent proprietary ad-hoc mode */
Signature · 1 line
1.6.0.6
PATCH 3/17 orinoco: spaces in parenthesised expressions
Remove checkpatch warnings of the following type:
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'
ERROR: space prohibited after that '!' (ctx:BxW)
ERROR: space required before the open parenthesis '('
ERROR: space required before the open brace '{'
--- drivers/net/wireless/orinoco/orinoco.c | 110 ++++++++++++++++---------------- 1 files changed, 55 insertions(+), 55 deletions(-)
drivers/net/wireless/orinoco/orinoco.c +55 -55
@@ -167,7 +167,7 @@ static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};#define ORINOCO_INTEN (HERMES_EV_RX | HERMES_EV_ALLOC \ | HERMES_EV_TX | HERMES_EV_TXEXC \ | HERMES_EV_WTERR | HERMES_EV_INFO \ - | HERMES_EV_INFDROP ) + | HERMES_EV_INFDROP)#define MAX_RID_LEN 1024
@@ -768,7 +768,7 @@ static int orinoco_open(struct net_device *dev) err =__orinoco_up (dev); -if (! err) +if (!err) priv->open =1 ;orinoco_unlock (priv, &flags);
@@ -810,7 +810,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)int err;unsigned long flags; -if (!netif_device_present (dev)) { +if (!netif_device_present (dev)) {printk (KERN_WARNING "%s: get_wireless_stats() called while device not present\n" , dev->name);return NULL ;/* FIXME: Can we do better than this? */
@@ -881,12 +881,12 @@ static int orinoco_change_mtu(struct net_device *dev, int new_mtu) {struct orinoco_private *priv =netdev_priv (dev); -if ( (new_mtu <ORINOCO_MIN_MTU ) || (new_mtu >ORINOCO_MAX_MTU ) ) +if ((new_mtu <ORINOCO_MIN_MTU ) || (new_mtu >ORINOCO_MAX_MTU ))return -EINVAL ;/* MTU + encapsulation + header length */ -if ( (new_mtu +ENCAPS_OVERHEAD +sizeof (struct ieee80211_hdr )) > - (priv->nicbuf_size -ETH_HLEN ) ) +if ((new_mtu +ENCAPS_OVERHEAD +sizeof (struct ieee80211_hdr )) > + (priv->nicbuf_size -ETH_HLEN ))return -EINVAL ; dev->mtu = new_mtu;
@@ -909,7 +909,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)int tx_control;unsigned long flags; -if (!netif_running (dev)) { +if (!netif_running (dev)) {printk (KERN_ERR "%s: Tx on stopped device!\n" , dev->name);return NETDEV_TX_BUSY ;
@@ -927,7 +927,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)return NETDEV_TX_BUSY ; } -if (!netif_carrier_ok (dev) || (priv->iw_mode ==IW_MODE_MONITOR )) { +if (!netif_carrier_ok (dev) || (priv->iw_mode ==IW_MODE_MONITOR )) {/* Oops, the firmware hasn't established a connection, silently drop the packet (this seems to be the safest approach). */
@@ -1203,7 +1203,7 @@ static inline int is_ethersnap(void *_hdr)* 00:00:f8 - we need both because different APs appear to use * different OUIs for some reason */ return (memcmp (hdr, &encaps_hdr,5 ) ==0 ) - && ( (hdr[5 ] ==0x00 ) || (hdr[5 ] ==0xf8 ) ); + && ((hdr[5 ] ==0x00 ) || (hdr[5 ] ==0xf8 )); } static inline void orinoco_spy_gather(struct net_device *dev, u_char *mac,
@@ -1700,14 +1700,14 @@ static void orinoco_join_ap(struct work_struct *work)/* Allocate buffer for scan results */ buf =kmalloc (MAX_SCAN_LEN ,GFP_KERNEL ); -if (! buf) +if (!buf)return ;if (orinoco_lock (priv, &flags) !=0 ) goto fail_lock;/* Sanity checks in case user changed something in the meantime */ -if (! priv->bssid_fixed) +if (!priv->bssid_fixed) goto out;if (strlen (priv->desired_essid) ==0 )
@@ -1735,7 +1735,7 @@ static void orinoco_join_ap(struct work_struct *work) } } -if (! found) { +if (!found) {DEBUG (1 ,"%s: Requested AP not found in scan results\n" , dev->name); goto out;
@@ -2174,7 +2174,7 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) {int i;printk (KERN_DEBUG "Scan result [%02X" , buf[0 ]); -for (i =1 ; i < (len *2 ); i++) +for (i =1 ; i < (len *2 ); i++)printk (":%02X" , buf[i]);printk ("]\n" ); }
@@ -2311,8 +2311,8 @@ int __orinoco_down(struct net_device *dev)netif_stop_queue (dev); -if (! priv->hw_unavailable) { -if (! priv->broken_disableport) { +if (!priv->hw_unavailable) { +if (!priv->broken_disableport) { err =hermes_disable_port (hw,0 );if (err) {/* Some firmwares (e.g. Intersil 1.3.x) seem
@@ -2475,7 +2475,7 @@ static int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv) }/* Write all 4 keys */ -for (i =0 ; i <ORINOCO_MAX_KEYS ; i++) { +for (i =0 ; i <ORINOCO_MAX_KEYS ; i++) { err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFDEFAULTKEY0 + i, HERMES_BYTES_TO_RECLEN(keylen),
@@ -2898,8 +2898,8 @@ __orinoco_set_multicast_list(struct net_device *dev)/* The Hermes doesn't seem to have an allmulti mode, so we go * into promiscuous mode and let the upper levels deal. */ -if ( (dev->flags &IFF_PROMISC ) || (dev->flags &IFF_ALLMULTI ) || - (dev->mc_count >MAX_MULTICAST (priv)) ) { +if ((dev->flags &IFF_PROMISC ) || (dev->flags &IFF_ALLMULTI ) || + (dev->mc_count >MAX_MULTICAST (priv))) { promisc =1 ; mc_count =0 ; }else {
@@ -2921,14 +2921,14 @@ __orinoco_set_multicast_list(struct net_device *dev)/* If we're not in promiscuous mode, then we need to set the * group address if either we want to multicast, or if we were * multicasting and want to stop */ -if (! promisc && (mc_count || priv->mc_count) ) { +if (!promisc && (mc_count || priv->mc_count)) {struct dev_mc_list *p = dev->mc_list;struct hermes_multicast mclist;int i;for (i =0 ; i < mc_count; i++) {/* paranoia: is list shorter than mc_count? */ -BUG_ON (! p); +BUG_ON (!p);/* paranoia: bad address size in list? */ BUG_ON (p->dmi_addrlen !=ETH_ALEN );
@@ -3008,7 +3008,7 @@ static void orinoco_reset(struct work_struct *work)/* priv->open or priv->hw_unavailable might have changed while * we dropped the lock */ -if (priv->open && (! priv->hw_unavailable)) { +if (priv->open && (!priv->hw_unavailable)) { err =__orinoco_up (dev);if (err) { printk(KERN_ERR "%s: orinoco_reset: Error %d reenabling card\n",
@@ -3066,7 +3066,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id) evstat =hermes_read_regn (hw,EVSTAT ); events = evstat & hw->inten; -if (! events) { +if (!events) {orinoco_unlock (priv, &flags);return IRQ_NONE ; }
@@ -3086,7 +3086,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id) }/* Check the card hasn't been removed */ -if (!hermes_present (hw)) { +if (!hermes_present (hw)) {DEBUG (0 ,"orinoco_interrupt(): card removed\n" );break ; }
@@ -3558,7 +3558,7 @@ static int orinoco_init(struct net_device *dev)/* Set up the default configuration */ priv->iw_mode =IW_MODE_INFRA ;/* By default use IEEE/IBSS ad-hoc mode if we have it */ - priv->prefer_port3 = priv->has_port3 && (! priv->has_ibss); + priv->prefer_port3 = priv->has_port3 && (!priv->has_ibss);set_port_type (priv); priv->channel =0 ;/* use firmware default */
@@ -3769,7 +3769,7 @@ static int orinoco_hw_get_freq(struct orinoco_private *priv) goto out; } -if ( (channel <1 ) || (channel >NUM_CHANNELS ) ) { +if ((channel <1 ) || (channel >NUM_CHANNELS )) {printk (KERN_WARNING "%s: Channel out of range (%d)!\n" , priv->ndev->name, channel); err = -EBUSY ;
@@ -4029,7 +4029,7 @@ static int orinoco_ioctl_getiwrange(struct net_device *dev,if (priv->has_wpa) range->enc_capa =IW_ENC_CAPA_WPA |IW_ENC_CAPA_CIPHER_TKIP ; -if ((priv->iw_mode ==IW_MODE_ADHOC ) && (!SPY_NUMBER (priv))){ +if ((priv->iw_mode ==IW_MODE_ADHOC ) && (!SPY_NUMBER (priv))) {/* Quality stats meaningless in ad-hoc mode */ }else { range->max_qual.qual =0x8b -0x2f ;
@@ -4106,7 +4106,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,int err = -EINPROGRESS ;/* Call commit handler */ unsigned long flags; -if (! priv->has_wep) +if (!priv->has_wep)return -EOPNOTSUPP ;if (erq->pointer) {
@@ -4114,7 +4114,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,if (erq->length >LARGE_KEY_SIZE )return -E2BIG ; -if ( (erq->length >SMALL_KEY_SIZE ) && !priv->has_big_wep ) +if ((erq->length >SMALL_KEY_SIZE ) && !priv->has_big_wep)return -E2BIG ; }
@@ -4147,13 +4147,13 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,* we will arrive there with an index of -1. This is valid * but need to be taken care off... Jean II */ if ((index <0 ) || (index >=ORINOCO_MAX_KEYS )) { -if ((index !=-1 ) || (erq->flags ==0 )) { +if ((index !=-1 ) || (erq->flags ==0 )) { err = -EINVAL ; goto out; } }else {/* Set the index : Check that the key is valid */ -if (priv->keys[index].len ==0 ) { +if (priv->keys[index].len ==0 ) { err = -EINVAL ; goto out; }
@@ -4204,7 +4204,7 @@ static int orinoco_ioctl_getiwencode(struct net_device *dev,u16 xlen =0 ;unsigned long flags; -if (! priv->has_wep) +if (!priv->has_wep)return -EOPNOTSUPP ;if (orinoco_lock (priv, &flags) !=0 )
@@ -4348,7 +4348,7 @@ static int orinoco_ioctl_setfreq(struct net_device *dev,if (priv->iw_mode ==IW_MODE_INFRA )return -EBUSY ; -if ( (frq->e ==0 ) && (frq->m <=1000 ) ) { +if ((frq->e ==0 ) && (frq->m <=1000 )) {/* Setting by channel number */ chan = frq->m; }else {
@@ -4363,8 +4363,8 @@ static int orinoco_ioctl_setfreq(struct net_device *dev, chan =ieee80211_freq_to_dsss_chan (frq->m / denom); } -if ( (chan <1 ) || (chan >NUM_CHANNELS ) || - ! (priv->channel_mask & (1 << (chan-1 )) ) ) +if ((chan <1 ) || (chan >NUM_CHANNELS ) || + !(priv->channel_mask & (1 << (chan-1 ))))return -EINVAL ;if (orinoco_lock (priv, &flags) !=0 )
@@ -4467,7 +4467,7 @@ static int orinoco_ioctl_setrts(struct net_device *dev,if (rrq->disabled) val =2347 ; -if ( (val <0 ) || (val >2347 ) ) +if ((val <0 ) || (val >2347 ))return -EINVAL ;if (orinoco_lock (priv, &flags) !=0 )
@@ -4519,7 +4519,7 @@ static int orinoco_ioctl_setfrag(struct net_device *dev,if (frq->disabled) priv->frag_thresh =2346 ;else { -if ( (frq->value <256 ) || (frq->value >2346 ) ) +if ((frq->value <256 ) || (frq->value >2346 )) err = -EINVAL ;else priv->frag_thresh = frq->value & ~0x1 ;/* must be even */
@@ -4553,7 +4553,7 @@ static int orinoco_ioctl_getfrag(struct net_device *dev, val =0 ; frq->value = val ?2347 :0 ; - frq->disabled = ! val; + frq->disabled = !val; frq->fixed =0 ; }else { err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFFRAGMENTATIONTHRESHOLD,
@@ -4593,13 +4593,13 @@ static int orinoco_ioctl_setrate(struct net_device *dev, bitrate = rrq->value /100000 ; } -if ( (bitrate !=10 ) && (bitrate !=20 ) && - (bitrate !=55 ) && (bitrate !=110 ) ) +if ((bitrate !=10 ) && (bitrate !=20 ) && + (bitrate !=55 ) && (bitrate !=110 ))return -EINVAL ;for (i =0 ; i <BITRATE_TABLE_SIZE ; i++) -if ( (bitrate_table[i].bitrate == bitrate) && - (bitrate_table[i].automatic == ! rrq->fixed) ) { +if ((bitrate_table[i].bitrate == bitrate) && + (bitrate_table[i].automatic == !rrq->fixed)) { ratemode = i;break ; }
@@ -4636,7 +4636,7 @@ static int orinoco_ioctl_getrate(struct net_device *dev,BUG_ON ((ratemode <0 ) || (ratemode >=BITRATE_TABLE_SIZE )); rrq->value = bitrate_table[ratemode].bitrate *100000 ; - rrq->fixed = ! bitrate_table[ratemode].automatic; + rrq->fixed = !bitrate_table[ratemode].automatic; rrq->disabled =0 ;/* If the interface is running we try to find more about the
@@ -4725,7 +4725,7 @@ static int orinoco_ioctl_setpower(struct net_device *dev, }/* It's valid to not have a value if we are just toggling * the flags... Jean II */ -if (!priv->pm_on) { +if (!priv->pm_on) { err = -EINVAL ; goto out; }
@@ -5221,7 +5221,7 @@ static int orinoco_ioctl_getretry(struct net_device *dev, }else { rrq->flags =IW_RETRY_LIMIT ; rrq->value = short_limit; -if (short_limit != long_limit) +if (short_limit != long_limit) rrq->flags |=IW_RETRY_SHORT ; } }
@@ -5239,7 +5239,7 @@ static int orinoco_ioctl_reset(struct net_device *dev, {struct orinoco_private *priv =netdev_priv (dev); -if (!capable (CAP_NET_ADMIN )) +if (!capable (CAP_NET_ADMIN ))return -EPERM ;if (info->cmd == (SIOCIWFIRSTPRIV +0x1 )) {
@@ -5263,7 +5263,7 @@ static int orinoco_ioctl_setibssport(struct net_device *dev, {struct orinoco_private *priv =netdev_priv (dev); -int val = *( (int *) extra ); +int val = *((int *) extra);unsigned long flags;if (orinoco_lock (priv, &flags) !=0 )
@@ -5296,7 +5296,7 @@ static int orinoco_ioctl_setport3(struct net_device *dev, char *extra) {struct orinoco_private *priv =netdev_priv (dev); -int val = *( (int *) extra ); +int val = *((int *) extra);int err =0 ;unsigned long flags;
@@ -5305,7 +5305,7 @@ static int orinoco_ioctl_setport3(struct net_device *dev,switch (val) {case 0 :/* Try to do IEEE ad-hoc mode */ -if (! priv->has_ibss) { +if (!priv->has_ibss) { err = -EINVAL ;break ; }
@@ -5314,7 +5314,7 @@ static int orinoco_ioctl_setport3(struct net_device *dev,break ;case 1 :/* Try to do Lucent proprietary ad-hoc mode */ -if (! priv->has_port3) { +if (!priv->has_port3) { err = -EINVAL ;break ; }
@@ -5325,7 +5325,7 @@ static int orinoco_ioctl_setport3(struct net_device *dev, err = -EINVAL ; } -if (! err) { +if (!err) {/* Actually update the mode we are using */ set_port_type (priv); err = -EINPROGRESS ;
@@ -5357,7 +5357,7 @@ static int orinoco_ioctl_setpreamble(struct net_device *dev,unsigned long flags;int val; -if (! priv->has_preamble) +if (!priv->has_preamble)return -EOPNOTSUPP ;/* 802.11b has recently defined some short preamble.
@@ -5365,7 +5365,7 @@ static int orinoco_ioctl_setpreamble(struct net_device *dev,* This increase performance, especially at high rates * (the preamble is transmitted at 1Mb/s), unfortunately * this give compatibility troubles... - Jean II */ - val = *( (int *) extra ); + val = *((int *) extra);if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ;
@@ -5388,7 +5388,7 @@ static int orinoco_ioctl_getpreamble(struct net_device *dev,struct orinoco_private *priv =netdev_priv (dev);int *val = (int *) extra; -if (! priv->has_preamble) +if (!priv->has_preamble)return -EOPNOTSUPP ; *val = priv->preamble;
@@ -5414,7 +5414,7 @@ static int orinoco_ioctl_getrid(struct net_device *dev,/* It's a "get" function, but we don't want users to access the * WEP key and other raw firmware data */ -if (!capable (CAP_NET_ADMIN )) +if (!capable (CAP_NET_ADMIN ))return -EPERM ;if (rid <0xfc00 || rid >0xffff )
@@ -5548,7 +5548,7 @@ static int orinoco_ioctl_setscan(struct net_device *dev, err =hermes_inquire (hw,HERMES_INQ_SCAN );/* One more client */ -if (! err) +if (!err) priv->scan_inprogress =1 ; out:
Signature · 1 line
1.6.0.6
PATCH 4/17 orinoco: remove unnecessary braces
Remove the following checkpatch warnings
WARNING: braces {} are not necessary for any arm of this statement
WARNING: braces {} are not necessary for single statement blocks
--- drivers/net/wireless/orinoco/orinoco.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-)
drivers/net/wireless/orinoco/orinoco.c +7 -11
@@ -3497,9 +3497,8 @@ static int orinoco_init(struct net_device *dev)/* Get initial AP density */ err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CNFSYSTEMSCALE , &priv->ap_density); -if (err || priv->ap_density <1 || priv->ap_density >3 ) { +if (err || priv->ap_density <1 || priv->ap_density >3 ) priv->has_sensitivity =0 ; - }/* Get initial RTS threshold */ err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD,
@@ -3811,9 +3810,8 @@ static int orinoco_hw_get_bitratelist(struct orinoco_private *priv, *numrates = num; num =min (num, max); -for (i =0 ; i < num; i++) { +for (i =0 ; i < num; i++) rates[i] = (p[i] &0x7f ) *500000 ;/* convert to bps */ - }return 0 ; }
@@ -4130,11 +4128,11 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev, index = priv->tx_key;/* Adjust key length to a supported value */ -if (erq->length >SMALL_KEY_SIZE ) { +if (erq->length >SMALL_KEY_SIZE ) xlen =LARGE_KEY_SIZE ; - }else if (erq->length >0 ) { +else if (erq->length >0 ) xlen =SMALL_KEY_SIZE ; - }else +else xlen =0 ;/* Switch on WEP if off */
@@ -4256,9 +4254,8 @@ static int orinoco_ioctl_setessid(struct net_device *dev,memset (priv->desired_essid,0 ,sizeof (priv->desired_essid));/* If not ANY, get the new ESSID */ -if (erq->flags) { +if (erq->flags)memcpy (priv->desired_essid, essidbuf, erq->length); - }orinoco_unlock (priv, &flags);
@@ -4393,9 +4390,8 @@ static int orinoco_ioctl_getfreq(struct net_device *dev,/* Locking done in there */ tmp =orinoco_hw_get_freq (priv); -if (tmp <0 ) { +if (tmp <0 )return tmp; - } frq->m = tmp *100000 ; frq->e =1 ;
Signature · 1 line
1.6.0.6
PATCH 5/17 orinoco: keep line length below 80 characters
Remove most checkpatch warnings of the type
WARNING: line over 80 characters
--- drivers/net/wireless/orinoco/orinoco.c | 113 +++++++++++++++++++------------- 1 files changed, 68 insertions(+), 45 deletions(-)
drivers/net/wireless/orinoco/orinoco.c +68 -45
@@ -101,8 +101,10 @@/* Module information */ /********************************************************************/ -MODULE_AUTHOR ("Pavel Roskin <[email protected]> & David Gibson <[email protected]>" ); -MODULE_DESCRIPTION ("Driver for Lucent Orinoco, Prism II based and similar wireless cards" ); +MODULE_AUTHOR ("Pavel Roskin <[email protected]> & " +"David Gibson <[email protected]>" ); +MODULE_DESCRIPTION ("Driver for Lucent Orinoco, Prism II based " +"and similar wireless cards" );MODULE_LICENSE ("Dual MPL/GPL" );/* Level of debugging. Used in the macros in orinoco.h */
@@ -116,9 +118,11 @@ EXPORT_SYMBOL(orinoco_debug);static int suppress_linkstatus;/* = 0 */ module_param (suppress_linkstatus, bool,0644 );MODULE_PARM_DESC (suppress_linkstatus,"Don't log link status changes" ); +static int ignore_disconnect;/* = 0 */ module_param (ignore_disconnect, int,0644 ); -MODULE_PARM_DESC (ignore_disconnect,"Don't report lost link to the network layer" ); +MODULE_PARM_DESC (ignore_disconnect, +"Don't report lost link to the network layer" );static int force_monitor;/* = 0 */ module_param (force_monitor, int,0644 );
@@ -840,7 +844,8 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev) wstats->qual.qual = priv->spy_data.spy_stat[0 ].qual; wstats->qual.level = priv->spy_data.spy_stat[0 ].level; wstats->qual.noise = priv->spy_data.spy_stat[0 ].noise; - wstats->qual.updated = priv->spy_data.spy_stat[0 ].updated; + wstats->qual.updated = + priv->spy_data.spy_stat[0 ].updated; } }else { struct {
@@ -854,7 +859,8 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev) wstats->qual.qual = (int )le16_to_cpu (cq.qual); wstats->qual.level = (int )le16_to_cpu (cq.signal) -0x95 ; wstats->qual.noise = (int )le16_to_cpu (cq.noise) -0x95 ; - wstats->qual.updated =IW_QUAL_ALL_UPDATED |IW_QUAL_DBM ; + wstats->qual.updated = +IW_QUAL_ALL_UPDATED |IW_QUAL_DBM ; } }
@@ -1571,7 +1577,8 @@ static void orinoco_rx(struct net_device *dev,/* These indicate a SNAP within 802.2 LLC within 802.11 frame which we'll need to de-encapsulate to the original EthernetII frame. */ - hdr = (struct ethhdr *)skb_push (skb,ETH_HLEN -ENCAPS_OVERHEAD ); + hdr = (struct ethhdr *)skb_push (skb, +ETH_HLEN -ENCAPS_OVERHEAD ); }else {/* 802.3 frame - prepend 802.3 header as is */ hdr = (struct ethhdr *)skb_push (skb,ETH_HLEN );
@@ -2379,25 +2386,26 @@ int orinoco_reinit_firmware(struct net_device *dev)static int __orinoco_hw_set_bitrate (struct orinoco_private *priv) {hermes_t *hw = &priv->hw; +int ratemode = priv->bitratemode;int err =0 ; -if (priv->bitratemode >=BITRATE_TABLE_SIZE ) { +if (ratemode >=BITRATE_TABLE_SIZE ) {printk (KERN_ERR "%s: BUG: Invalid bitrate mode %d\n" , - priv->ndev->name, priv->bitratemode); + priv->ndev->name, ratemode);return -EINVAL ; }switch (priv->firmware_type) {case FIRMWARE_TYPE_AGERE : err =hermes_write_wordrec (hw,USER_BAP , -HERMES_RID_CNFTXRATECONTROL , - bitrate_table[priv->bitratemode].agere_txratectrl); +HERMES_RID_CNFTXRATECONTROL , + bitrate_table[ratemode].agere_txratectrl);break ;case FIRMWARE_TYPE_INTERSIL :case FIRMWARE_TYPE_SYMBOL : err =hermes_write_wordrec (hw,USER_BAP , -HERMES_RID_CNFTXRATECONTROL , - bitrate_table[priv->bitratemode].intersil_txratectrl); +HERMES_RID_CNFTXRATECONTROL , + bitrate_table[ratemode].intersil_txratectrl);break ;default :BUG ();
@@ -2465,7 +2473,8 @@ static int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv)int keylen;int i; -/* Force uniform key length to work around firmware bugs */ +/* Force uniform key length to work around +* firmware bugs */ keylen =le16_to_cpu (priv->keys[priv->tx_key].len);if (keylen >LARGE_KEY_SIZE ) {
@@ -2477,17 +2486,17 @@ static int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv)/* Write all 4 keys */ for (i =0 ; i <ORINOCO_MAX_KEYS ; i++) { err =hermes_write_ltv (hw,USER_BAP , -HERMES_RID_CNFDEFAULTKEY0 + i, -HERMES_BYTES_TO_RECLEN (keylen), - priv->keys[i].data); +HERMES_RID_CNFDEFAULTKEY0 + i, +HERMES_BYTES_TO_RECLEN (keylen), + priv->keys[i].data);if (err)return err; }/* Write the index of the key used in transmission */ err =hermes_write_wordrec (hw,USER_BAP , -HERMES_RID_CNFWEPDEFAULTKEYID , - priv->tx_key); +HERMES_RID_CNFWEPDEFAULTKEYID , + priv->tx_key);if (err)return err; }
@@ -2526,8 +2535,8 @@ static int __orinoco_hw_setup_enc(struct orinoco_private *priv)if (priv->encode_alg ==IW_ENCODE_ALG_WEP ) {/* Enable the shared-key authentication. */ err =hermes_write_wordrec (hw,USER_BAP , -HERMES_RID_CNFAUTHENTICATION_AGERE , - auth_flag); +HERMES_RID_CNFAUTHENTICATION_AGERE , + auth_flag); } err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFWEPENABLED_AGERE,
@@ -2730,16 +2739,16 @@ static int __orinoco_program_rids(struct net_device *dev)memcpy (&idbuf.val, priv->desired_essid,sizeof (idbuf.val));/* WinXP wants partner to configure OWNSSID even in IBSS mode. (jimc) */ err =hermes_write_ltv (hw,USER_BAP ,HERMES_RID_CNFOWNSSID , -HERMES_BYTES_TO_RECLEN (strlen (priv->desired_essid)+2 ), - &idbuf); +HERMES_BYTES_TO_RECLEN (strlen (priv->desired_essid)+2 ), + &idbuf);if (err) {printk (KERN_ERR "%s: Error %d setting OWNSSID\n" , dev->name, err);return err; } err =hermes_write_ltv (hw,USER_BAP ,HERMES_RID_CNFDESIREDSSID , -HERMES_BYTES_TO_RECLEN (strlen (priv->desired_essid)+2 ), - &idbuf); +HERMES_BYTES_TO_RECLEN (strlen (priv->desired_essid)+2 ), + &idbuf);if (err) {printk (KERN_ERR "%s: Error %d setting DESIREDSSID\n" , dev->name, err);
@@ -2764,7 +2773,7 @@ static int __orinoco_program_rids(struct net_device *dev)HERMES_RID_CNFSYSTEMSCALE , priv->ap_density);if (err) { -printk (KERN_WARNING "%s: Error %d setting SYSTEMSCALE. " +printk (KERN_WARNING "%s: Error %d setting SYSTEMSCALE. " "Disabling sensitivity control\n" , dev->name, err);
@@ -3002,7 +3011,8 @@ static void orinoco_reset(struct work_struct *work) goto disable; } -spin_lock_irq (&priv->lock);/* This has to be called from user context */ +/* This has to be called from user context */ +spin_lock_irq (&priv->lock); priv->hw_unavailable--;
@@ -3293,7 +3303,8 @@ static int determine_firmware(struct net_device *dev) SYMBOL_MAX_VER_LEN, NULL, &tmp);if (err) {printk (KERN_WARNING -"%s: Error %d reading Symbol firmware info. Wildly guessing capabilities...\n" , +"%s: Error %d reading Symbol firmware info. " +"Wildly guessing capabilities...\n" , dev->name, err); firmver =0 ; tmp[0 ] ='\0' ;
@@ -3302,8 +3313,10 @@ static int determine_firmware(struct net_device *dev)* something like : "V2.20-01". * Quick and dirty parsing... - Jean II */ - firmver = ((tmp[1 ] -'0' ) <<16 ) | ((tmp[3 ] -'0' ) <<12 ) - | ((tmp[4 ] -'0' ) <<8 ) | ((tmp[6 ] -'0' ) <<4 ) + firmver = ((tmp[1 ] -'0' ) <<16 ) + | ((tmp[3 ] -'0' ) <<12 ) + | ((tmp[4 ] -'0' ) <<8 ) + | ((tmp[6 ] -'0' ) <<4 ) | (tmp[7 ] -'0' ); tmp[SYMBOL_MAX_VER_LEN ] ='\0' ;
@@ -3336,7 +3349,7 @@ static int determine_firmware(struct net_device *dev) priv->do_fw_download = (priv->stop_fw !=NULL ); priv->broken_disableport = (firmver ==0x25013 ) || - (firmver >=0x30000 && firmver <=0x31000 ); + (firmver >=0x30000 && firmver <=0x31000 ); priv->has_hostscan = (firmver >=0x31001 ) || (firmver >=0x29057 && firmver <0x30000 );/* Tested with Intel firmware : 0x20015 => Jean II */
@@ -3423,7 +3436,8 @@ static int orinoco_init(struct net_device *dev) }if (priv->has_port3) -printk (KERN_DEBUG "%s: Ad-hoc demo mode supported\n" , dev->name); +printk (KERN_DEBUG "%s: Ad-hoc demo mode supported\n" , + dev->name);if (priv->has_ibss)printk (KERN_DEBUG "%s: IEEE standard IBSS ad-hoc mode supported\n" , dev->name);
@@ -3515,7 +3529,8 @@ static int orinoco_init(struct net_device *dev)HERMES_RID_CNFMWOROBUST_AGERE , &priv->mwo_robust); else - err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CNFFRAGMENTATIONTHRESHOLD , + err =hermes_read_wordrec (hw,USER_BAP , +HERMES_RID_CNFFRAGMENTATIONTHRESHOLD , &priv->frag_thresh);if (err) { printk(KERN_ERR "%s: failed to read fragmentation settings!\n",
@@ -3758,7 +3773,8 @@ static int orinoco_hw_get_freq(struct orinoco_private *priv)if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; - err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CURRENTCHANNEL , &channel); + err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CURRENTCHANNEL , + &channel);if (err) goto out;
@@ -4064,7 +4080,8 @@ static int orinoco_ioctl_getiwrange(struct net_device *dev, range->max_pmt =65535 *1000 ;/* ??? */ range->pmp_flags =IW_POWER_PERIOD ; range->pmt_flags =IW_POWER_TIMEOUT ; - range->pm_capa =IW_POWER_PERIOD |IW_POWER_TIMEOUT |IW_POWER_UNICAST_R ; + range->pm_capa = (IW_POWER_PERIOD |IW_POWER_TIMEOUT | +IW_POWER_UNICAST_R ); range->retry_capa =IW_RETRY_LIMIT |IW_RETRY_LIFETIME ; range->retry_flags =IW_RETRY_LIMIT ;
@@ -4506,9 +4523,10 @@ static int orinoco_ioctl_setfrag(struct net_device *dev, priv->mwo_robust =0 ; else {if (frq->fixed) -printk (KERN_WARNING "%s: Fixed fragmentation is " -"not supported on this firmware. " -"Using MWO robust instead.\n" , dev->name); +printk (KERN_WARNING "%s: Fixed fragmentation " +"is not supported on this firmware. " +"Using MWO robust instead.\n" , + dev->name); priv->mwo_robust =1 ; } }else {
@@ -4518,7 +4536,8 @@ static int orinoco_ioctl_setfrag(struct net_device *dev,if ((frq->value <256 ) || (frq->value >2346 )) err = -EINVAL ;else - priv->frag_thresh = frq->value & ~0x1 ;/* must be even */ +/* must be even */ + priv->frag_thresh = frq->value & ~0x1 ; } }
@@ -4552,7 +4571,8 @@ static int orinoco_ioctl_getfrag(struct net_device *dev, frq->disabled = !val; frq->fixed =0 ; }else { - err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CNFFRAGMENTATIONTHRESHOLD , + err =hermes_read_wordrec (hw,USER_BAP , +HERMES_RID_CNFFRAGMENTATIONTHRESHOLD , &val);if (err) val =0 ;
@@ -4747,7 +4767,8 @@ static int orinoco_ioctl_getpower(struct net_device *dev,if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; - err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CNFPMENABLED , &enable); + err =hermes_read_wordrec (hw,USER_BAP , +HERMES_RID_CNFPMENABLED , &enable);if (err) goto out;
@@ -4756,11 +4777,13 @@ static int orinoco_ioctl_getpower(struct net_device *dev,if (err) goto out; - err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CNFPMHOLDOVERDURATION , &timeout); + err =hermes_read_wordrec (hw,USER_BAP , +HERMES_RID_CNFPMHOLDOVERDURATION , &timeout);if (err) goto out; - err =hermes_read_wordrec (hw,USER_BAP ,HERMES_RID_CNFMULTICASTRECEIVE , &mcast); + err =hermes_read_wordrec (hw,USER_BAP , +HERMES_RID_CNFMULTICASTRECEIVE , &mcast);if (err) goto out;
@@ -5486,9 +5509,9 @@ static int orinoco_ioctl_setscan(struct net_device *dev,switch (priv->firmware_type) {case FIRMWARE_TYPE_SYMBOL : err =hermes_write_wordrec (hw,USER_BAP , -HERMES_RID_CNFHOSTSCAN_SYMBOL , -HERMES_HOSTSCAN_SYMBOL_ONCE | -HERMES_HOSTSCAN_SYMBOL_BCAST ); +HERMES_RID_CNFHOSTSCAN_SYMBOL , +HERMES_HOSTSCAN_SYMBOL_ONCE | +HERMES_HOSTSCAN_SYMBOL_BCAST );break ;case FIRMWARE_TYPE_INTERSIL : {__le16 req[3 ];
Signature · 1 line
1.6.0.6
PATCH 6/17 orinoco: Fix interesting checkpatch errors
ERROR: "foo * bar" should be "foo *bar"
ERROR: do not initialise statics to 0 or NULL
WARNING: printk() should include KERN_ facility level
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
--- drivers/net/wireless/orinoco/orinoco.c | 52 +++++++++++++------------------ 1 files changed, 22 insertions(+), 30 deletions(-)
drivers/net/wireless/orinoco/orinoco.c +22 -30
@@ -110,9 +110,9 @@ MODULE_LICENSE("Dual MPL/GPL");/* Level of debugging. Used in the macros in orinoco.h */ #ifdef ORINOCO_DEBUG int orinoco_debug =ORINOCO_DEBUG ; +EXPORT_SYMBOL (orinoco_debug);module_param (orinoco_debug, int,0644 );MODULE_PARM_DESC (orinoco_debug,"Debug level" ); -EXPORT_SYMBOL (orinoco_debug);#endif static int suppress_linkstatus;/* = 0 */
@@ -1650,7 +1650,7 @@ static void orinoco_rx_isr_tasklet(unsigned long data)static void print_linkstatus (struct net_device *dev,u16 status) { -char * s; +char *s;if (suppress_linkstatus)return ;
@@ -2309,6 +2309,7 @@ int __orinoco_up(struct net_device *dev)return 0 ; } +EXPORT_SYMBOL (__orinoco_up);int __orinoco_down (struct net_device *dev) {
@@ -2340,6 +2341,7 @@ int __orinoco_down(struct net_device *dev)return 0 ; } +EXPORT_SYMBOL (__orinoco_down);static int orinoco_allocate_fid (struct net_device *dev) {
@@ -2350,16 +2352,12 @@ static int orinoco_allocate_fid(struct net_device *dev) err =hermes_allocate (hw, priv->nicbuf_size, &priv->txfid);if (err == -EIO && priv->nicbuf_size >TX_NICBUF_SIZE_BUG ) {/* Try workaround for old Symbol firmware bug */ -printk (KERN_WARNING "%s: firmware ALLOC bug detected " -"(old Symbol firmware?). Trying to work around... " , - dev->name); - priv->nicbuf_size =TX_NICBUF_SIZE_BUG ; err =hermes_allocate (hw, priv->nicbuf_size, &priv->txfid); -if (err) -printk ("failed!\n" ); -else -printk ("ok.\n" ); + +printk (KERN_WARNING "%s: firmware ALLOC bug detected " +"(old Symbol firmware?). Work around %s\n" , + dev->name, err ?"failed!" :"ok." ); }return err;
@@ -2382,6 +2380,7 @@ int orinoco_reinit_firmware(struct net_device *dev)return err; } +EXPORT_SYMBOL (orinoco_reinit_firmware);static int __orinoco_hw_set_bitrate (struct orinoco_private *priv) {
@@ -3060,12 +3059,14 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id)hermes_t *hw = &priv->hw;int count =MAX_IRQLOOPS_PER_IRQ ;u16 evstat, events; -/* These are used to detect a runaway interrupt situation */ -/* If we get more than MAX_IRQLOOPS_PER_JIFFY iterations in a jiffy, -* we panic and shut down the hardware */ -static int last_irq_jiffy =0 ;/* jiffies value the last time -* we were called */ -static int loops_this_jiffy =0 ; +/* These are used to detect a runaway interrupt situation. +* +* If we get more than MAX_IRQLOOPS_PER_JIFFY iterations in a jiffy, +* we panic and shut down the hardware +*/ +/* jiffies value the last time we were called */ +static int last_irq_jiffy;/* = 0 */ +static int loops_this_jiffy;/* = 0 */ unsigned long flags;if (orinoco_lock (priv, &flags) !=0 ) {
@@ -3127,6 +3128,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id)orinoco_unlock (priv, &flags);return IRQ_HANDLED ; } +EXPORT_SYMBOL (orinoco_interrupt);/********************************************************************/ /* Power management */
@@ -3442,11 +3444,8 @@ static int orinoco_init(struct net_device *dev)printk (KERN_DEBUG "%s: IEEE standard IBSS ad-hoc mode supported\n" , dev->name);if (priv->has_wep) { -printk (KERN_DEBUG "%s: WEP supported, " , dev->name); -if (priv->has_big_wep) -printk ("104-bit key\n" ); -else -printk ("40-bit key\n" ); +printk (KERN_DEBUG "%s: WEP supported, %s-bit key\n" , dev->name, + priv->has_big_wep ?"104" :"40" ); }if (priv->has_wpa) {printk (KERN_DEBUG "%s: WPA-PSK supported\n" , dev->name);
@@ -3672,6 +3671,7 @@ struct net_devicereturn dev; } +EXPORT_SYMBOL (alloc_orinocodev);void free_orinocodev (struct net_device *dev) {
@@ -3701,6 +3701,7 @@ void free_orinocodev(struct net_device *dev)orinoco_bss_data_free (priv);free_netdev (dev); } +EXPORT_SYMBOL (free_orinocodev);/********************************************************************/ /* Wireless extensions */
@@ -6143,15 +6144,6 @@ static const struct ethtool_ops orinoco_ethtool_ops = {/* Module initialization */ /********************************************************************/ -EXPORT_SYMBOL (alloc_orinocodev); -EXPORT_SYMBOL (free_orinocodev); - -EXPORT_SYMBOL (__orinoco_up); -EXPORT_SYMBOL (__orinoco_down); -EXPORT_SYMBOL (orinoco_reinit_firmware); - -EXPORT_SYMBOL (orinoco_interrupt); -/* Can't be declared "const" or the whole __initdata section will * become const */ static char version[]__initdata =DRIVER_NAME " " DRIVER_VERSION
Signature · 1 line
1.6.0.6
PATCH 7/17 orinoco: Rename orinoco.c
So that we can split up the file and still produce a module named orinoco.o.
---
drivers/net/wireless/orinoco/Makefile | 1 +
drivers/net/wireless/orinoco/airport.c | 2 +-
drivers/net/wireless/orinoco/{orinoco.c => main.c} | 2 +-
drivers/net/wireless/orinoco/orinoco_cs.c | 2 +-
drivers/net/wireless/orinoco/orinoco_pci.h | 2 +-
drivers/net/wireless/orinoco/orinoco_tmd.c | 2 +-
drivers/net/wireless/orinoco/spectrum_cs.c | 4 ++--
7 files changed, 8 insertions(+), 7 deletions(-)
rename drivers/net/wireless/orinoco/{orinoco.c => main.c} (99%)drivers/net/wireless/orinoco/Makefile +1 -0
@@ -1,6 +1,7 @@ # # Makefile for the orinoco wireless device drivers. # +orinoco-objs := main.o obj-$(CONFIG_HERMES) += orinoco.o hermes.o hermes_dld.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
drivers/net/wireless/orinoco/airport.c +1 -1
@@ -3,7 +3,7 @@* A driver for "Hermes" chipset based Apple Airport wireless * card. * -* Copyright notice & release notes in file orinoco.c +* Copyright notice & release notes in file main.c * * Note specific to airport stub: *
drivers/net/wireless/orinoco/main.c renamed from drivers/net/wireless/orinoco/orinoco.c +1 -1
@@ -1,4 +1,4 @@ -/* orinoco.c - (formerly known as dldwd_cs.c and orinoco_cs.c) +/* main.c - (formerly known as dldwd_cs.c, orinoco_cs.c and orinoco.c) * * A driver for Hermes or Prism 2 chipset based PCMCIA wireless * adaptors, with Lucent/Agere, Intersil or Symbol firmware.
drivers/net/wireless/orinoco/orinoco_cs.c +1 -1
@@ -7,7 +7,7 @@* Linksys, D-Link and Farallon Skyline. It should also work on Symbol * cards such as the 3Com AirConnect and Ericsson WLAN. * -* Copyright notice & release notes in file orinoco.c +* Copyright notice & release notes in file main.c */ #define DRIVER_NAME "orinoco_cs"
drivers/net/wireless/orinoco/orinoco_pci.h +1 -1
@@ -4,7 +4,7 @@* both native PCI and PCMCIA-to-PCI bridges. * * Copyright (C) 2005, Pavel Roskin. -* See orinoco.c for license. +* See main.c for license. */ #ifndef _ORINOCO_PCI_H
drivers/net/wireless/orinoco/orinoco_tmd.c +1 -1
@@ -27,7 +27,7 @@* provisions above, a recipient may use your version of this file * under either the MPL or the GPL. * -* The actual driving is done by orinoco.c, this is just resource +* The actual driving is done by main.c, this is just resource * allocation stuff. * * This driver is modeled after the orinoco_plx driver. The main
drivers/net/wireless/orinoco/spectrum_cs.c +2 -2
@@ -4,7 +4,7 @@* Communications and Intel PRO/Wireless 2011B. * * The driver implements Symbol firmware download. The rest is handled -* in hermes.c and orinoco.c. +* in hermes.c and main.c. * * Utilities for downloading the Symbol firmware are available at * http://sourceforge.net/projects/orinoco/
@@ -15,7 +15,7 @@* Portions based on Spectrum24tDnld.c from original spectrum24 driver: * Copyright (C) Symbol Technologies. * -* See copyright notice in file orinoco.c. +* See copyright notice in file main.c. */ #define DRIVER_NAME "spectrum_cs"
Signature · 1 line
1.6.0.6
PATCH 8/17 orinoco: use orinoco_private instead of net_device in scan helper
This makes the interface to the scan helpers consistent, so we can split them out.
--- drivers/net/wireless/orinoco/main.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/orinoco/main.c +5 -5
@@ -1929,11 +1929,10 @@ static void orinoco_add_ext_scan_result(struct orinoco_private *priv, } } -static int orinoco_process_scan_results (struct net_device *dev, +static int orinoco_process_scan_results (struct orinoco_private *priv,unsigned char *buf,int len) { -struct orinoco_private *priv =netdev_priv (dev);int offset;/* In the scan data */ union hermes_scan_info *atom;int atom_len;
@@ -1967,7 +1966,8 @@ static int orinoco_process_scan_results(struct net_device *dev,/* Sanity check for atom_len */ if (atom_len <sizeof (struct prism2_scan_apinfo )) {printk (KERN_ERR "%s: Invalid atom_len in scan " -"data: %d\n" , dev->name, atom_len); +"data: %d\n" , priv->ndev->name, + atom_len);return -EIO ; } }else
@@ -1980,7 +1980,7 @@ static int orinoco_process_scan_results(struct net_device *dev,/* Check that we got an whole number of atoms */ if ((len - offset) % atom_len) {printk (KERN_ERR "%s: Unexpected scan data length %d, " -"atom_len %d, offset %d\n" , dev->name, len, +"atom_len %d, offset %d\n" , priv->ndev->name, len, atom_len, offset);return -EIO ; }
@@ -2187,7 +2187,7 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) }#endif /* ORINOCO_DEBUG */ -if (orinoco_process_scan_results (dev, buf, len) ==0 ) { +if (orinoco_process_scan_results (priv, buf, len) ==0 ) {/* Send an empty event to user space. * We don't send the received data on the event because * it would require us to do complex transcoding, and
Signature · 1 line
1.6.0.6
PATCH 9/17 orinoco: Move scan helpers to a separate file
No functional change.
--- drivers/net/wireless/orinoco/Makefile | 2 +- drivers/net/wireless/orinoco/main.c | 220 +------------------------------ drivers/net/wireless/orinoco/scan.c | 233 +++++++++++++++++++++++++++++++++ drivers/net/wireless/orinoco/scan.h | 29 ++++ 4 files changed, 265 insertions(+), 219 deletions(-) create mode 100644 drivers/net/wireless/orinoco/scan.c create mode 100644 drivers/net/wireless/orinoco/scan.h
drivers/net/wireless/orinoco/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the orinoco wireless device drivers. # -orinoco-objs := main.o +orinoco-objs := main.o scan.o obj-$(CONFIG_HERMES) += orinoco.o hermes.o hermes_dld.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
drivers/net/wireless/orinoco/main.c +2 -218
238 lines not on this page · raw message
drivers/net/wireless/orinoco/scan.c new file +233 -0
233 lines not on this page · raw message
drivers/net/wireless/orinoco/scan.h new file +29 -0
@@ -0,0 +1,29 @@ +/* Helpers for managing scan queues +* +* See copyright notice in main.c +*/ +#ifndef _ORINOCO_SCAN_H_ +#define _ORINOCO_SCAN_H_ + +/* Forward declarations */ +struct orinoco_private ; +struct agere_ext_scan_info ; + +/* Setup and free memory for scan results */ +int orinoco_bss_data_allocate (struct orinoco_private *priv); +void orinoco_bss_data_free (struct orinoco_private *priv); +void orinoco_bss_data_init (struct orinoco_private *priv); + +/* Add scan results */ +void orinoco_add_ext_scan_result (struct orinoco_private *priv, +struct agere_ext_scan_info *atom); +int orinoco_process_scan_results (struct orinoco_private *dev, +unsigned char *buf, +int len); + +/* Clear scan results */ +void orinoco_clear_scan_results (struct orinoco_private *priv, +unsigned long scan_age); + + +#endif /* _ORINOCO_SCAN_H_ */
Signature · 1 line
1.6.0.6
PATCH 10/17 orinoco: Move MIC helpers into new file
No functional change.
--- drivers/net/wireless/orinoco/Makefile | 2 +- drivers/net/wireless/orinoco/main.c | 72 +----------------------------- drivers/net/wireless/orinoco/mic.c | 79 +++++++++++++++++++++++++++++++++ drivers/net/wireless/orinoco/mic.h | 22 +++++++++ 4 files changed, 103 insertions(+), 72 deletions(-) create mode 100644 drivers/net/wireless/orinoco/mic.c create mode 100644 drivers/net/wireless/orinoco/mic.h
drivers/net/wireless/orinoco/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the orinoco wireless device drivers. # -orinoco-objs := main.o scan.o +orinoco-objs := main.o mic.o scan.o obj-$(CONFIG_HERMES) += orinoco.o hermes.o hermes_dld.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
drivers/net/wireless/orinoco/main.c +1 -71
87 lines not on this page · raw message
drivers/net/wireless/orinoco/mic.c new file +79 -0
79 lines not on this page · raw message
drivers/net/wireless/orinoco/mic.h new file +22 -0
@@ -0,0 +1,22 @@ +/* Orinoco MIC helpers +* +* See copyright notice in main.c +*/ +#ifndef _ORINOCO_MIC_H_ +#define _ORINOCO_MIC_H_ + +#include <linux/types.h> + +#define MICHAEL_MIC_LEN 8 + +/* Forward declarations */ +struct orinoco_private ; +struct crypto_hash ; + +int orinoco_mic_init (struct orinoco_private *priv); +void orinoco_mic_free (struct orinoco_private *priv); +int michael_mic (struct crypto_hash *tfm_michael,u8 *key, +u8 *da,u8 *sa,u8 priority, +u8 *data,size_t data_len,u8 *mic); + +#endif /* ORINOCO_MIC_H */
Signature · 1 line
1.6.0.6
PATCH 11/17 orinoco: Move firmware handling into a separate file
No functional change.
--- drivers/net/wireless/orinoco/Makefile | 2 +- drivers/net/wireless/orinoco/fw.c | 340 +++++++++++++++++++++++++++++++++ drivers/net/wireless/orinoco/fw.h | 16 ++ drivers/net/wireless/orinoco/main.c | 335 +-------------------------------- 4 files changed, 358 insertions(+), 335 deletions(-) create mode 100644 drivers/net/wireless/orinoco/fw.c create mode 100644 drivers/net/wireless/orinoco/fw.h
drivers/net/wireless/orinoco/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the orinoco wireless device drivers. # -orinoco-objs := main.o mic.o scan.o +orinoco-objs := main.o fw.o mic.o scan.o obj-$(CONFIG_HERMES) += orinoco.o hermes.o hermes_dld.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
drivers/net/wireless/orinoco/fw.c new file +340 -0
340 lines not on this page · raw message
drivers/net/wireless/orinoco/fw.h new file +16 -0
@@ -0,0 +1,16 @@ +/* Firmware file reading and download helpers +* +* See copyright notice in main.c +*/ +#ifndef _ORINOCO_FW_H_ +#define _ORINOCO_FW_H_ + +/* Forward declations */ +struct orinoco_private ; + +int orinoco_download (struct orinoco_private *priv); + +void orinoco_cache_fw (struct orinoco_private *priv,int ap); +void orinoco_uncache_fw (struct orinoco_private *priv); + +#endif /* _ORINOCO_FW_H_ */
drivers/net/wireless/orinoco/main.c +1 -334
353 lines not on this page · raw message
Signature · 1 line
1.6.0.6
PATCH 12/17 orinoco: Use accessor functions for bitrate tables
... when used by the WEXT ioctl functions. This will allow us to separate the card specific stuff from the WEXT code.
--- drivers/net/wireless/orinoco/main.c | 140 ++++++++++++++++++++--------------- 1 files changed, 81 insertions(+), 59 deletions(-)
drivers/net/wireless/orinoco/main.c +81 -59
@@ -282,6 +282,33 @@ static inline void set_port_type(struct orinoco_private *priv) } } +static int orinoco_get_bitratemode (int bitrate,int automatic) +{ +int ratemode =-1 ; +int i; + +if ((bitrate !=10 ) && (bitrate !=20 ) && + (bitrate !=55 ) && (bitrate !=110 )) +return ratemode; + +for (i =0 ; i <BITRATE_TABLE_SIZE ; i++) { +if ((bitrate_table[i].bitrate == bitrate) && + (bitrate_table[i].automatic == automatic)) { + ratemode = i; +break ; + } + } +return ratemode; +} + +static void orinoco_get_ratemode_cfg (int ratemode,int *bitrate,int *automatic) +{ +BUG_ON ((ratemode <0 ) || (ratemode >=BITRATE_TABLE_SIZE )); + + *bitrate = bitrate_table[ratemode].bitrate *100000 ; + *automatic = bitrate_table[ratemode].automatic; +} +static inline u8 *orinoco_get_ie (u8 *data,size_t len,enum ieee80211_eid eid) {
@@ -1794,6 +1821,50 @@ static int __orinoco_hw_set_bitrate(struct orinoco_private *priv)return err; } +static int orinoco_hw_get_act_bitrate (struct orinoco_private *priv, +int *bitrate) +{ +hermes_t *hw = &priv->hw; +int i; +int err =0 ; +u16 val; + + err =hermes_read_wordrec (hw,USER_BAP , +HERMES_RID_CURRENTTXRATE , &val); +if (err) +return err; + +switch (priv->firmware_type) { +case FIRMWARE_TYPE_AGERE :/* Lucent style rate */ +/* Note : in Lucent firmware, the return value of +* HERMES_RID_CURRENTTXRATE is the bitrate in Mb/s, +* and therefore is totally different from the +* encoding of HERMES_RID_CNFTXRATECONTROL. +* Don't forget that 6Mb/s is really 5.5Mb/s */ +if (val ==6 ) + *bitrate =5500000 ; +else + *bitrate = val *1000000 ; +break ; +case FIRMWARE_TYPE_INTERSIL :/* Intersil style rate */ +case FIRMWARE_TYPE_SYMBOL :/* Symbol style rate */ +for (i =0 ; i <BITRATE_TABLE_SIZE ; i++) +if (bitrate_table[i].intersil_txratectrl == val) +break ; + +if (i >=BITRATE_TABLE_SIZE ) +printk (KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n" , + priv->ndev->name, val); + + *bitrate = bitrate_table[i].bitrate *100000 ; +break ; +default : +BUG (); + } + +return err; +} +/* Set fixed AP address */ static int __orinoco_hw_set_wap (struct orinoco_private *priv) {
@@ -3975,9 +4046,8 @@ static int orinoco_ioctl_setrate(struct net_device *dev, char *extra) {struct orinoco_private *priv =netdev_priv (dev); -int ratemode =-1 ; +int ratemode;int bitrate;/* 100s of kilobits */ -int i;unsigned long flags;/* As the user space doesn't know our highest rate, it uses -1
@@ -3991,16 +4061,7 @@ static int orinoco_ioctl_setrate(struct net_device *dev, bitrate = rrq->value /100000 ; } -if ((bitrate !=10 ) && (bitrate !=20 ) && - (bitrate !=55 ) && (bitrate !=110 )) -return -EINVAL ; - -for (i =0 ; i <BITRATE_TABLE_SIZE ; i++) -if ((bitrate_table[i].bitrate == bitrate) && - (bitrate_table[i].automatic == !rrq->fixed)) { - ratemode = i; -break ; - } + ratemode =orinoco_get_bitratemode (bitrate, !rrq->fixed);if (ratemode ==-1 )return -EINVAL ;
@@ -4019,65 +4080,26 @@ static int orinoco_ioctl_getrate(struct net_device *dev, char *extra) {struct orinoco_private *priv =netdev_priv (dev); -hermes_t *hw = &priv->hw;int err =0 ; -int ratemode; -int i; -u16 val; +int bitrate, automatic;unsigned long flags;if (orinoco_lock (priv, &flags) !=0 )return -EBUSY ; - ratemode = priv->bitratemode; - -BUG_ON ((ratemode <0 ) || (ratemode >=BITRATE_TABLE_SIZE )); - - rrq->value = bitrate_table[ratemode].bitrate *100000 ; - rrq->fixed = !bitrate_table[ratemode].automatic; - rrq->disabled =0 ; +orinoco_get_ratemode_cfg (priv->bitratemode, &bitrate, &automatic);/* If the interface is running we try to find more about the current mode */ -if (netif_running (dev)) { - err =hermes_read_wordrec (hw,USER_BAP , -HERMES_RID_CURRENTTXRATE , &val); -if (err) - goto out; +if (netif_running (dev)) + err =orinoco_hw_get_act_bitrate (priv, &bitrate); -switch (priv->firmware_type) { -case FIRMWARE_TYPE_AGERE :/* Lucent style rate */ -/* Note : in Lucent firmware, the return value of -* HERMES_RID_CURRENTTXRATE is the bitrate in Mb/s, -* and therefore is totally different from the -* encoding of HERMES_RID_CNFTXRATECONTROL. -* Don't forget that 6Mb/s is really 5.5Mb/s */ -if (val ==6 ) - rrq->value =5500000 ; -else - rrq->value = val *1000000 ; -break ; -case FIRMWARE_TYPE_INTERSIL :/* Intersil style rate */ -case FIRMWARE_TYPE_SYMBOL :/* Symbol style rate */ -for (i =0 ; i <BITRATE_TABLE_SIZE ; i++) -if (bitrate_table[i].intersil_txratectrl == val) { - ratemode = i; -break ; - } -if (i >=BITRATE_TABLE_SIZE ) -printk (KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n" , - dev->name, val); - - rrq->value = bitrate_table[ratemode].bitrate *100000 ; -break ; -default : -BUG (); - } - } - - out:orinoco_unlock (priv, &flags); + rrq->value = bitrate; + rrq->fixed = !automatic; + rrq->disabled =0 ; +return err; }
Signature · 1 line
1.6.0.6
PATCH 13/17 orinoco: Add hardware function to set multicast mode
No functional change.
--- drivers/net/wireless/orinoco/main.c | 51 +++++++++++++++++++++------------- 1 files changed, 31 insertions(+), 20 deletions(-)
drivers/net/wireless/orinoco/main.c +31 -20
@@ -2347,25 +2347,12 @@ static int __orinoco_program_rids(struct net_device *dev)return 0 ; } -/* FIXME: return int? */ -static void -__orinoco_set_multicast_list (struct net_device *dev) +static int __orinoco_hw_set_multicast_list (struct orinoco_private *priv, +struct dev_addr_list *mc_list, +int mc_count,int promisc) { -struct orinoco_private *priv =netdev_priv (dev);hermes_t *hw = &priv->hw;int err =0 ; -int promisc, mc_count; - -/* The Hermes doesn't seem to have an allmulti mode, so we go -* into promiscuous mode and let the upper levels deal. */ -if ((dev->flags &IFF_PROMISC ) || (dev->flags &IFF_ALLMULTI ) || - (dev->mc_count >MAX_MULTICAST (priv))) { - promisc =1 ; - mc_count =0 ; - }else { - promisc =0 ; - mc_count = dev->mc_count; - }if (promisc != priv->promiscuous) { err = hermes_write_wordrec(hw, USER_BAP,
@@ -2373,7 +2360,7 @@ __orinoco_set_multicast_list(struct net_device *dev) promisc);if (err) {printk (KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n" , - dev->name, err); + priv->ndev->name, err); }else priv->promiscuous = promisc; }
@@ -2382,7 +2369,7 @@ __orinoco_set_multicast_list(struct net_device *dev)* group address if either we want to multicast, or if we were * multicasting and want to stop */ if (!promisc && (mc_count || priv->mc_count)) { -struct dev_mc_list *p = dev->mc_list; +struct dev_mc_list *p = mc_list;struct hermes_multicast mclist;int i;
@@ -2398,7 +2385,7 @@ __orinoco_set_multicast_list(struct net_device *dev)if (p)printk (KERN_WARNING "%s: Multicast list is " -"longer than mc_count\n" , dev->name); +"longer than mc_count\n" , priv->ndev->name); err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES,
@@ -2406,10 +2393,34 @@ __orinoco_set_multicast_list(struct net_device *dev) &mclist);if (err)printk (KERN_ERR "%s: Error %d setting multicast list.\n" , - dev->name, err); + priv->ndev->name, err);else priv->mc_count = mc_count; } +return err; +} + +/* FIXME: return int? */ +static void +__orinoco_set_multicast_list (struct net_device *dev) +{ +struct orinoco_private *priv =netdev_priv (dev); +int err =0 ; +int promisc, mc_count; + +/* The Hermes doesn't seem to have an allmulti mode, so we go +* into promiscuous mode and let the upper levels deal. */ +if ((dev->flags &IFF_PROMISC ) || (dev->flags &IFF_ALLMULTI ) || + (dev->mc_count >MAX_MULTICAST (priv))) { + promisc =1 ; + mc_count =0 ; + }else { + promisc =0 ; + mc_count = dev->mc_count; + } + + err =__orinoco_hw_set_multicast_list (priv, dev->mc_list, mc_count, + promisc); }/* This must be called from user context, without locks held - use
Signature · 1 line
1.6.0.6
PATCH 14/17 orinoco: Move hardware functions into separate file
No functional change.
--- drivers/net/wireless/orinoco/Makefile | 2 +- drivers/net/wireless/orinoco/hw.c | 586 +++++++++++++++++++++++++++++++++ drivers/net/wireless/orinoco/hw.h | 47 +++ drivers/net/wireless/orinoco/main.c | 583 +-------------------------------- 4 files changed, 635 insertions(+), 583 deletions(-) create mode 100644 drivers/net/wireless/orinoco/hw.c create mode 100644 drivers/net/wireless/orinoco/hw.h
drivers/net/wireless/orinoco/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the orinoco wireless device drivers. # -orinoco-objs := main.o fw.o mic.o scan.o +orinoco-objs := main.o fw.o hw.o mic.o scan.o obj-$(CONFIG_HERMES) += orinoco.o hermes.o hermes_dld.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
drivers/net/wireless/orinoco/hw.c new file +586 -0
586 lines not on this page · raw message
drivers/net/wireless/orinoco/hw.h new file +47 -0
47 lines not on this page · raw message
drivers/net/wireless/orinoco/main.c +1 -582
636 lines not on this page · raw message
Signature · 1 line
1.6.0.6
PATCH 15/17 orinoco: Move WEXT handlers into a separate file
No functional change.
--- drivers/net/wireless/orinoco/Makefile | 2 +- drivers/net/wireless/orinoco/main.c | 2355 +-------------------------------- drivers/net/wireless/orinoco/main.h | 63 + drivers/net/wireless/orinoco/wext.c | 2325 ++++++++++++++++++++++++++++++++ drivers/net/wireless/orinoco/wext.h | 13 + 5 files changed, 2408 insertions(+), 2350 deletions(-) create mode 100644 drivers/net/wireless/orinoco/main.h create mode 100644 drivers/net/wireless/orinoco/wext.c create mode 100644 drivers/net/wireless/orinoco/wext.h
drivers/net/wireless/orinoco/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the orinoco wireless device drivers. # -orinoco-objs := main.o fw.o hw.o mic.o scan.o +orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o obj-$(CONFIG_HERMES) += orinoco.o hermes.o hermes_dld.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
drivers/net/wireless/orinoco/main.c +6 -2349
2,419 lines not on this page · raw message
drivers/net/wireless/orinoco/main.h new file +63 -0
63 lines not on this page · raw message
drivers/net/wireless/orinoco/wext.c new file +2325 -0
510 lines not on this page · raw message
drivers/net/wireless/orinoco/wext.h new file +13 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.0.6
Part of the diff is not shown here. View the raw message.
PATCH 16/17 orinoco: hermes_dld does not need to be a module
--- drivers/net/wireless/orinoco/Makefile | 4 +- drivers/net/wireless/orinoco/hermes_dld.c | 33 +--------------------------- 2 files changed, 4 insertions(+), 33 deletions(-)
drivers/net/wireless/orinoco/Makefile +2 -2
@@ -1,9 +1,9 @@ # # Makefile for the orinoco wireless device drivers. # -orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o +orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o hermes_dld.o -obj-$(CONFIG_HERMES) += orinoco.o hermes.o hermes_dld.o +obj-$(CONFIG_HERMES) += orinoco.o hermes.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o obj-$(CONFIG_APPLE_AIRPORT) += airport.o obj-$(CONFIG_PLX_HERMES) += orinoco_plx.o
drivers/net/wireless/orinoco/hermes_dld.c +2 -31
@@ -1,13 +1,7 @@/* -* Hermes download helper driver. +* Hermes download helper. * -* This could be entirely merged into hermes.c. -* -* I'm keeping it separate to minimise the amount of merging between -* kernel upgrades. It also means the memory overhead for drivers that -* don't need firmware download low. -* -* This driver: +* This helper: * - is capable of writing to the volatile area of the hermes device * - is currently not capable of writing to non-volatile areas * - provide helpers to identify and update plugin data
@@ -50,10 +44,6 @@#include "hermes.h" #include "hermes_dld.h" -MODULE_DESCRIPTION ("Download helper for Lucent Hermes chipset" ); -MODULE_AUTHOR ("David Kilroy <[email protected]>" ); -MODULE_LICENSE ("Dual MPL/GPL" ); -#define PFX "hermes_dld: "/*
@@ -347,7 +337,6 @@ int hermes_read_pda(hermes_t *hw,return 0 ; } -EXPORT_SYMBOL (hermes_read_pda);/* Parse PDA and write the records into the adapter *
@@ -376,7 +365,6 @@ int hermes_apply_pda(hermes_t *hw, }return 0 ; } -EXPORT_SYMBOL (hermes_apply_pda);/* Identify the total number of bytes in all blocks * including the header data.
@@ -398,7 +386,6 @@ hermes_blocks_length(const char *first_block)return total_len; } -EXPORT_SYMBOL (hermes_blocks_length);/*** Hermes programming ***/
@@ -452,7 +439,6 @@ int hermesi_program_init(hermes_t *hw, u32 offset)return err; } -EXPORT_SYMBOL (hermesi_program_init);/* Done programming data (Hermes I) *
@@ -488,7 +474,6 @@ int hermesi_program_end(hermes_t *hw)return rc ? rc : err; } -EXPORT_SYMBOL (hermesi_program_end);/* Program the data blocks */ int hermes_program (hermes_t *hw,const char *first_block,const char *end)
@@ -550,19 +535,6 @@ int hermes_program(hermes_t *hw, const char *first_block, const char *end) }return 0 ; } -EXPORT_SYMBOL (hermes_program); - -static int __init init_hermes_dld (void ) -{ -return 0 ; -} - -static void __exit exit_hermes_dld(void) -{ -} - -module_init (init_hermes_dld); -module_exit (exit_hermes_dld);/*** Default plugging data for Hermes I ***/ /* Values from wl_lkm_718/hcf/dhf.c */
@@ -727,4 +699,3 @@ int hermes_apply_pda_with_defaults(hermes_t *hw, }return 0 ; } -EXPORT_SYMBOL (hermes_apply_pda_with_defaults);
Signature · 1 line
1.6.0.6
PATCH 17/17 orinoco: hermes doesn't need to be a separate module
Just compile it into the orinoco module. If we merge USB support, the module can then be split as appropriate.
--- drivers/net/wireless/orinoco/Makefile | 4 ++-- drivers/net/wireless/orinoco/hermes.c | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-)
drivers/net/wireless/orinoco/Makefile +2 -2
@@ -1,9 +1,9 @@ # # Makefile for the orinoco wireless device drivers. # -orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o hermes_dld.o +orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o hermes_dld.o hermes.o -obj-$(CONFIG_HERMES) += orinoco.o hermes.o +obj-$(CONFIG_HERMES) += orinoco.o obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o obj-$(CONFIG_APPLE_AIRPORT) += airport.o obj-$(CONFIG_PLX_HERMES) += orinoco_plx.o
drivers/net/wireless/orinoco/hermes.c +0 -18
@@ -45,12 +45,6 @@#include "hermes.h" -MODULE_DESCRIPTION ("Low-level driver helper for Lucent Hermes chipset" -" and Prism II HFA384x wireless MAC controller" ); -MODULE_AUTHOR ("Pavel Roskin <[email protected]>" -" & David Gibson <[email protected]>" ); -MODULE_LICENSE ("Dual MPL/GPL" ); -/* These are maximum timeouts. Most often, card wil react much faster */ #define CMD_BUSY_TIMEOUT (100)/* In iterations of ~1us */ #define CMD_INIT_TIMEOUT (50000)/* in iterations of ~10us */
@@ -542,15 +536,3 @@ int hermes_write_ltv(hermes_t *hw, int bap, u16 rid,return err; }EXPORT_SYMBOL (hermes_write_ltv); - -static int __init init_hermes (void ) -{ -return 0 ; -} - -static void __exit exit_hermes(void) -{ -} - -module_init (init_hermes); -module_exit (exit_hermes);
Signature · 1 line
1.6.0.6
Quoted 6 lines · David Kilroy
This patch series reorganises the orinoco driver. The focus is on splitting up the monolithic
orinoco.cto make future changes easier.Because of patch conflicts, I've included Andrey's checkpatch cleanup patch. However there is still a conflict with Harvey Harrison's "wireless: replace use of __constant_{endian}" patch.
I see my timing is perfect :)
Since wireless-testing now has both these patches, I'll rebase this series and repost.
Dave.