aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring/tms380tr.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/tokenring/tms380tr.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/tokenring/tms380tr.c')
-rw-r--r--drivers/net/tokenring/tms380tr.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index a7b6888829b5..8b508c922410 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -85,7 +85,6 @@ static const char version[] = "tms380tr.c: v1.10 30/12/2002 by Christoph Goos, A
85#include <linux/ptrace.h> 85#include <linux/ptrace.h>
86#include <linux/ioport.h> 86#include <linux/ioport.h>
87#include <linux/in.h> 87#include <linux/in.h>
88#include <linux/slab.h>
89#include <linux/string.h> 88#include <linux/string.h>
90#include <linux/time.h> 89#include <linux/time.h>
91#include <linux/errno.h> 90#include <linux/errno.h>
@@ -693,7 +692,7 @@ static netdev_tx_t tms380tr_hardware_send_packet(struct sk_buff *skb,
693 * NOTE: This function should be used whenever the status of any TPL must be 692 * NOTE: This function should be used whenever the status of any TPL must be
694 * modified by the driver, because the compiler may otherwise change the 693 * modified by the driver, because the compiler may otherwise change the
695 * order of instructions such that writing the TPL status may be executed at 694 * order of instructions such that writing the TPL status may be executed at
696 * an undesireable time. When this function is used, the status is always 695 * an undesirable time. When this function is used, the status is always
697 * written when the function is called. 696 * written when the function is called.
698 */ 697 */
699static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status) 698static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status)
@@ -729,8 +728,8 @@ static void tms380tr_timer_chk(unsigned long data)
729 return; 728 return;
730 729
731 tms380tr_chk_outstanding_cmds(dev); 730 tms380tr_chk_outstanding_cmds(dev);
732 if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) 731 if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) &&
733 && (tp->TplFree != tp->TplBusy)) 732 (tp->TplFree != tp->TplBusy))
734 { 733 {
735 /* Anything to send, but stalled too long */ 734 /* Anything to send, but stalled too long */
736 tp->LastSendTime = jiffies; 735 tp->LastSendTime = jiffies;
@@ -830,8 +829,8 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id)
830 } 829 }
831 830
832 /* Reset system interrupt if not already done. */ 831 /* Reset system interrupt if not already done. */
833 if(irq_type != STS_IRQ_TRANSMIT_STATUS 832 if(irq_type != STS_IRQ_TRANSMIT_STATUS &&
834 && irq_type != STS_IRQ_RECEIVE_STATUS) { 833 irq_type != STS_IRQ_RECEIVE_STATUS) {
835 tms380tr_reset_interrupt(dev); 834 tms380tr_reset_interrupt(dev);
836 } 835 }
837 836
@@ -895,10 +894,10 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy
895 894
896 /* Check if this interrupt does use the SSB. */ 895 /* Check if this interrupt does use the SSB. */
897 896
898 if(IrqType != STS_IRQ_TRANSMIT_STATUS 897 if(IrqType != STS_IRQ_TRANSMIT_STATUS &&
899 && IrqType != STS_IRQ_RECEIVE_STATUS 898 IrqType != STS_IRQ_RECEIVE_STATUS &&
900 && IrqType != STS_IRQ_COMMAND_STATUS 899 IrqType != STS_IRQ_COMMAND_STATUS &&
901 && IrqType != STS_IRQ_RING_STATUS) 900 IrqType != STS_IRQ_RING_STATUS)
902 { 901 {
903 return (1); /* SSB not involved. */ 902 return (1); /* SSB not involved. */
904 } 903 }
@@ -1212,10 +1211,9 @@ static void tms380tr_set_multicast_list(struct net_device *dev)
1212 } 1211 }
1213 else 1212 else
1214 { 1213 {
1215 int i; 1214 struct dev_mc_list *mclist;
1216 struct dev_mc_list *mclist = dev->mc_list; 1215
1217 for (i=0; i< dev->mc_count; i++) 1216 netdev_for_each_mc_addr(mclist, dev) {
1218 {
1219 ((char *)(&tp->ocpl.FunctAddr))[0] |= 1217 ((char *)(&tp->ocpl.FunctAddr))[0] |=
1220 mclist->dmi_addr[2]; 1218 mclist->dmi_addr[2];
1221 ((char *)(&tp->ocpl.FunctAddr))[1] |= 1219 ((char *)(&tp->ocpl.FunctAddr))[1] |=
@@ -1224,7 +1222,6 @@ static void tms380tr_set_multicast_list(struct net_device *dev)
1224 mclist->dmi_addr[4]; 1222 mclist->dmi_addr[4];
1225 ((char *)(&tp->ocpl.FunctAddr))[3] |= 1223 ((char *)(&tp->ocpl.FunctAddr))[3] |=
1226 mclist->dmi_addr[5]; 1224 mclist->dmi_addr[5];
1227 mclist = mclist->next;
1228 } 1225 }
1229 } 1226 }
1230 tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR); 1227 tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR);
@@ -1364,6 +1361,8 @@ static int tms380tr_reset_adapter(struct net_device *dev)
1364 return (-1); 1361 return (-1);
1365} 1362}
1366 1363
1364MODULE_FIRMWARE("tms380tr.bin");
1365
1367/* 1366/*
1368 * Starts bring up diagnostics of token ring adapter and evaluates 1367 * Starts bring up diagnostics of token ring adapter and evaluates
1369 * diagnostic results. 1368 * diagnostic results.
@@ -1483,8 +1482,8 @@ static int tms380tr_init_adapter(struct net_device *dev)
1483 /* Mask interesting status bits */ 1482 /* Mask interesting status bits */
1484 Status = SIFREADW(SIFSTS); 1483 Status = SIFREADW(SIFSTS);
1485 Status &= STS_MASK; 1484 Status &= STS_MASK;
1486 } while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) 1485 } while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) &&
1487 && ((Status & STS_ERROR) == 0) && (loop_cnt != 0)); 1486 ((Status & STS_ERROR) == 0) && (loop_cnt != 0));
1488 1487
1489 if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0) 1488 if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0)
1490 { 1489 {
@@ -2181,8 +2180,8 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
2181 } 2180 }
2182 } 2181 }
2183 2182
2184 if(skb && (rpl->SkbStat == SKB_DATA_COPY 2183 if(skb && (rpl->SkbStat == SKB_DATA_COPY ||
2185 || rpl->SkbStat == SKB_DMA_DIRECT)) 2184 rpl->SkbStat == SKB_DMA_DIRECT))
2186 { 2185 {
2187 if(rpl->SkbStat == SKB_DATA_COPY) 2186 if(rpl->SkbStat == SKB_DATA_COPY)
2188 skb_copy_to_linear_data(skb, ReceiveDataPtr, 2187 skb_copy_to_linear_data(skb, ReceiveDataPtr,
@@ -2264,7 +2263,7 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
2264 * This function should be used whenever the status of any RPL must be 2263 * This function should be used whenever the status of any RPL must be
2265 * modified by the driver, because the compiler may otherwise change the 2264 * modified by the driver, because the compiler may otherwise change the
2266 * order of instructions such that writing the RPL status may be executed 2265 * order of instructions such that writing the RPL status may be executed
2267 * at an undesireable time. When this function is used, the status is 2266 * at an undesirable time. When this function is used, the status is
2268 * always written when the function is called. 2267 * always written when the function is called.
2269 */ 2268 */
2270static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status) 2269static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status)