aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c505.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-15 02:12:00 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-15 02:12:00 -0500
commit5e30589521518bff36fd2638b3c3d69679c50436 (patch)
tree6ac985658a06b0787e4354d0d16d380ea9b16a5a /drivers/net/3c505.c
parentac178ef0ae9eb44fd527d87aa9b6394e05f56e1f (diff)
parentd2f8d7ee1a9b4650b4e43325b321801264f7c37a (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: drivers/net/wireless/iwlwifi/iwl-agn.c drivers/net/wireless/iwlwifi/iwl3945-base.c
Diffstat (limited to 'drivers/net/3c505.c')
-rw-r--r--drivers/net/3c505.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index ea1ad8ce8836..2de1c9cd7bde 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -493,21 +493,27 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
493 } 493 }
494 /* read the data */ 494 /* read the data */
495 spin_lock_irqsave(&adapter->lock, flags); 495 spin_lock_irqsave(&adapter->lock, flags);
496 i = 0; 496 for (i = 0; i < MAX_PCB_DATA; i++) {
497 do { 497 for (j = 0; j < 20000; j++) {
498 j = 0; 498 stat = get_status(dev->base_addr);
499 while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && j++ < 20000); 499 if (stat & ACRF)
500 pcb->data.raw[i++] = inb_command(dev->base_addr); 500 break;
501 if (i > MAX_PCB_DATA) 501 }
502 INVALID_PCB_MSG(i); 502 pcb->data.raw[i] = inb_command(dev->base_addr);
503 } while ((stat & ASF_PCB_MASK) != ASF_PCB_END && j < 20000); 503 if ((stat & ASF_PCB_MASK) == ASF_PCB_END || j >= 20000)
504 break;
505 }
504 spin_unlock_irqrestore(&adapter->lock, flags); 506 spin_unlock_irqrestore(&adapter->lock, flags);
507 if (i >= MAX_PCB_DATA) {
508 INVALID_PCB_MSG(i);
509 return false;
510 }
505 if (j >= 20000) { 511 if (j >= 20000) {
506 TIMEOUT_MSG(__LINE__); 512 TIMEOUT_MSG(__LINE__);
507 return false; 513 return false;
508 } 514 }
509 /* woops, the last "data" byte was really the length! */ 515 /* the last "data" byte was really the length! */
510 total_length = pcb->data.raw[--i]; 516 total_length = pcb->data.raw[i];
511 517
512 /* safety check total length vs data length */ 518 /* safety check total length vs data length */
513 if (total_length != (pcb->length + 2)) { 519 if (total_length != (pcb->length + 2)) {