aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-05-14 11:30:22 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-15 17:53:26 -0400
commit84d8a2fb56b1d3c915591a2c1aa321b783c7d00f (patch)
tree351f0ba1ab4a0d9e15439efed03a62a91138789e /drivers/net/wireless
parentad8f451b41b3c3438ec4eef15527972bebd854eb (diff)
[PATCH] orinoco: misc fixes
small fixes from CVS that didn't fit elsewhere Index: linux-2.6/drivers/net/wireless/orinoco.c ===================================================================
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/orinoco.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index cf55eca5586b..b1078baa1d5e 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1280,9 +1280,10 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
1280 len = sizeof(tallies); 1280 len = sizeof(tallies);
1281 } 1281 }
1282 1282
1283 /* Read directly the data (no seek) */ 1283 err = hermes_bap_pread(hw, IRQ_BAP, &tallies, len,
1284 hermes_read_words(hw, HERMES_DATA1, (void *) &tallies, 1284 infofid, sizeof(info));
1285 len / 2); /* FIXME: blech! */ 1285 if (err)
1286 break;
1286 1287
1287 /* Increment our various counters */ 1288 /* Increment our various counters */
1288 /* wstats->discard.nwid - no wrong BSSID stuff */ 1289 /* wstats->discard.nwid - no wrong BSSID stuff */
@@ -1312,8 +1313,10 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
1312 break; 1313 break;
1313 } 1314 }
1314 1315
1315 hermes_read_words(hw, HERMES_DATA1, (void *) &linkstatus, 1316 err = hermes_bap_pread(hw, IRQ_BAP, &linkstatus, len,
1316 len / 2); 1317 infofid, sizeof(info));
1318 if (err)
1319 break;
1317 newstatus = le16_to_cpu(linkstatus.linkstatus); 1320 newstatus = le16_to_cpu(linkstatus.linkstatus);
1318 1321
1319 connected = (newstatus == HERMES_LINKSTATUS_CONNECTED) 1322 connected = (newstatus == HERMES_LINKSTATUS_CONNECTED)
@@ -1355,6 +1358,8 @@ int __orinoco_up(struct net_device *dev)
1355 struct hermes *hw = &priv->hw; 1358 struct hermes *hw = &priv->hw;
1356 int err; 1359 int err;
1357 1360
1361 netif_carrier_off(dev); /* just to make sure */
1362
1358 err = __orinoco_program_rids(dev); 1363 err = __orinoco_program_rids(dev);
1359 if (err) { 1364 if (err) {
1360 printk(KERN_ERR "%s: Error %d configuring card\n", 1365 printk(KERN_ERR "%s: Error %d configuring card\n",
@@ -2063,7 +2068,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2063 if (events & HERMES_EV_ALLOC) 2068 if (events & HERMES_EV_ALLOC)
2064 __orinoco_ev_alloc(dev, hw); 2069 __orinoco_ev_alloc(dev, hw);
2065 2070
2066 hermes_write_regn(hw, EVACK, events); 2071 hermes_write_regn(hw, EVACK, evstat);
2067 2072
2068 evstat = hermes_read_regn(hw, EVSTAT); 2073 evstat = hermes_read_regn(hw, EVSTAT);
2069 events = evstat & hw->inten; 2074 events = evstat & hw->inten;
@@ -2440,7 +2445,7 @@ struct net_device *alloc_orinocodev(int sizeof_card,
2440 priv = netdev_priv(dev); 2445 priv = netdev_priv(dev);
2441 priv->ndev = dev; 2446 priv->ndev = dev;
2442 if (sizeof_card) 2447 if (sizeof_card)
2443 priv->card = (void *)((unsigned long)netdev_priv(dev) 2448 priv->card = (void *)((unsigned long)priv
2444 + sizeof(struct orinoco_private)); 2449 + sizeof(struct orinoco_private));
2445 else 2450 else
2446 priv->card = NULL; 2451 priv->card = NULL;
@@ -2545,6 +2550,7 @@ static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
2545 } 2550 }
2546 2551
2547 len = le16_to_cpu(essidbuf.len); 2552 len = le16_to_cpu(essidbuf.len);
2553 BUG_ON(len > IW_ESSID_MAX_SIZE);
2548 2554
2549 memset(buf, 0, IW_ESSID_MAX_SIZE+1); 2555 memset(buf, 0, IW_ESSID_MAX_SIZE+1);
2550 memcpy(buf, p, len); 2556 memcpy(buf, p, len);