Skip to contentSkip to conversation

orinoco: reorganisation

PATCH New David Kilroy 1 participant 17 messages Feb 4, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

v2 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.

This series has been rebased on top of master-2009-02-03 to eliminate conflicts.

Regards,

Dave.
---

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     |    2 +-
 drivers/net/wireless/orinoco/fw.c          |  340 ++
 drivers/net/wireless/orinoco/fw.h          |   16 +
 drivers/net/wireless/orinoco/hermes.c      |   18 -
 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_cs.c  |    2 +-
 drivers/net/wireless/orinoco/orinoco_pci.h |    2 +-
 drivers/net/wireless/orinoco/orinoco_tmd.c |    2 +-
 drivers/net/wireless/orinoco/scan.c        |  233 ++
 drivers/net/wireless/orinoco/scan.h        |   29 +
 drivers/net/wireless/orinoco/spectrum_cs.c |    4 +-
 drivers/net/wireless/orinoco/wext.c        | 2325 +++++++++++
 drivers/net/wireless/orinoco/wext.h        |   13 +
 21 files changed, 6417 insertions(+), 6209 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
#1 lore raw

PATCH v2 1/16 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
index e082ef0..0e21eaf 100644
@@ -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 = cpu_to_be16(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
#2 lore raw

PATCH v2 2/16 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
index 0e21eaf..6ff6c38 100644
@@ -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
#3 lore raw

PATCH v2 3/16 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
index 6ff6c38..b1c763f 100644
@@ -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
#4 lore raw

PATCH v2 4/16 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
index b1c763f..acfced8 100644
@@ -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
#5 lore raw

PATCH v2 5/16 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
index acfced8..1544eff 100644
@@ -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_device
 
 	return 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
#6 lore raw

PATCH v2 6/16 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
index 791366e..d2ac785 100644
@@ -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
index 5582dca..8c4065f 100644
@@ -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
similarity index 99%
rename from drivers/net/wireless/orinoco/orinoco.c
rename to drivers/net/wireless/orinoco/main.c
index 1544eff..e43e3e2 100644
@@ -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
index d194b3e..b381aed 100644
@@ -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
index 88df3ee..c655b4a 100644
@@ -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
index e77c404..cda0e6e 100644
@@ -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
index 9aefe19..38e5198 100644
@@ -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
#7 lore raw

PATCH v2 7/16 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
index e43e3e2..9e8da9c 100644
@@ -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
#8 lore raw

PATCH v2 8/16 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
index d2ac785..efde451 100644
@@ -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
new file mode 100644
index 0000000..f319f74
@@ -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
#9 lore raw

PATCH v2 9/16 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
index efde451..9d3ef29 100644
@@ -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
new file mode 100644
index 0000000..bc1db16
@@ -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
#10 lore raw

PATCH v2 10/16 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
index 9d3ef29..fecdbce 100644
@@ -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
new file mode 100644
index 0000000..2290f08
@@ -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
#11 lore raw

PATCH v2 11/16 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
index e937afd..1617e10 100644
@@ -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
#12 lore raw

PATCH v2 12/16 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
index 1617e10..846113b 100644
@@ -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
#13 lore raw

PATCH v2 13/16 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
index fecdbce..f40f54d 100644
@@ -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
#14 lore raw

PATCH v2 14/16 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
index f40f54d..431ba39 100644
@@ -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
new file mode 100644
index 0000000..1479f4e

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.

#15 lore raw

PATCH v2 15/16 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
index 431ba39..2f3e0dd 100644
@@ -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
index 45aed14..5260ceb 100644
@@ -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
#16 lore raw

PATCH v2 16/16 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
index 2f3e0dd..1fc7409 100644
@@ -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
index f48358f..f2c918c 100644
@@ -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 */
@@ -540,15 +534,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