aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-17 11:43:49 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-17 11:43:49 -0500
commitaa62a869454c5900687822ee117f2d3494e2ea62 (patch)
treec35afd74503cbf17543869ce3c28e7b6ec7656d0 /drivers/net
parentde29cba9c9bb2dc35803e8d5c968a454e297b8f3 (diff)
parenta26e01d71622a4cecad06ce85bcab3ed878e7f83 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: [IRDA]: irda parameters warning fixes. [IRDA]: stir4200 fixes. [IRDA]: irlmp_unregister_link() needs to free lsaps. [IRDA]: mcs7780 needs to free allocated rx buffer. [IRDA]: Race between open and disconnect in irda-usb. [SCTP]: Flush fragment queue when exiting partial delivery. [AX25]: Locking dependencies fix in ax25_disconnect(). [IPV4]: Make tcp_input_metrics() get minimum RTO via tcp_rto_min() [IPV6]: Fix the return value of ipv6_getsockopt [BRIDGE]: Assign random address. [IPV4]: Updates to nfsroot documentation [ATM]: Fix compiler warning noise with FORE200E driver [NETFILTER]: bridge: fix missing link layer headers on outgoing routed packets [SYNCPPP]: Endianness and 64bit fixes. [TIPC]: Fix semaphore handling. [NETFILTER]: xt_hashlimit should use time_after_eq() [XFRM]: Display the audited SPI value in host byte order. [NETFILTER]: ip_tables: fix compat copy race [NETFILTER]: ctnetlink: set expected bit for related conntracks
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/irda/irda-usb.c5
-rw-r--r--drivers/net/irda/mcs7780.c2
-rw-r--r--drivers/net/irda/stir4200.c10
-rw-r--r--drivers/net/wan/syncppp.c35
4 files changed, 30 insertions, 22 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index c6355c00fd7a..9081234ab458 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1168,6 +1168,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
1168static int irda_usb_net_open(struct net_device *netdev) 1168static int irda_usb_net_open(struct net_device *netdev)
1169{ 1169{
1170 struct irda_usb_cb *self; 1170 struct irda_usb_cb *self;
1171 unsigned long flags;
1171 char hwname[16]; 1172 char hwname[16];
1172 int i; 1173 int i;
1173 1174
@@ -1177,13 +1178,16 @@ static int irda_usb_net_open(struct net_device *netdev)
1177 self = (struct irda_usb_cb *) netdev->priv; 1178 self = (struct irda_usb_cb *) netdev->priv;
1178 IRDA_ASSERT(self != NULL, return -1;); 1179 IRDA_ASSERT(self != NULL, return -1;);
1179 1180
1181 spin_lock_irqsave(&self->lock, flags);
1180 /* Can only open the device if it's there */ 1182 /* Can only open the device if it's there */
1181 if(!self->present) { 1183 if(!self->present) {
1184 spin_unlock_irqrestore(&self->lock, flags);
1182 IRDA_WARNING("%s(), device not present!\n", __FUNCTION__); 1185 IRDA_WARNING("%s(), device not present!\n", __FUNCTION__);
1183 return -1; 1186 return -1;
1184 } 1187 }
1185 1188
1186 if(self->needspatch) { 1189 if(self->needspatch) {
1190 spin_unlock_irqrestore(&self->lock, flags);
1187 IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ; 1191 IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ;
1188 return -EIO ; 1192 return -EIO ;
1189 } 1193 }
@@ -1198,6 +1202,7 @@ static int irda_usb_net_open(struct net_device *netdev)
1198 /* To do *before* submitting Rx urbs and starting net Tx queue 1202 /* To do *before* submitting Rx urbs and starting net Tx queue
1199 * Jean II */ 1203 * Jean II */
1200 self->netopen = 1; 1204 self->netopen = 1;
1205 spin_unlock_irqrestore(&self->lock, flags);
1201 1206
1202 /* 1207 /*
1203 * Now that everything should be initialized properly, 1208 * Now that everything should be initialized properly,
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index 0b769192d4ce..93916cf33f29 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -677,6 +677,8 @@ static int mcs_net_close(struct net_device *netdev)
677 /* Stop transmit processing */ 677 /* Stop transmit processing */
678 netif_stop_queue(netdev); 678 netif_stop_queue(netdev);
679 679
680 kfree_skb(mcs->rx_buff.skb);
681
680 /* kill and free the receive and transmit URBs */ 682 /* kill and free the receive and transmit URBs */
681 usb_kill_urb(mcs->rx_urb); 683 usb_kill_urb(mcs->rx_urb);
682 usb_free_urb(mcs->rx_urb); 684 usb_free_urb(mcs->rx_urb);
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
index 042bc2f0417d..e59c485bc497 100644
--- a/drivers/net/irda/stir4200.c
+++ b/drivers/net/irda/stir4200.c
@@ -142,9 +142,6 @@ enum StirCtrl2Mask {
142}; 142};
143 143
144enum StirFifoCtlMask { 144enum StirFifoCtlMask {
145 FIFOCTL_EOF = 0x80,
146 FIFOCTL_UNDER = 0x40,
147 FIFOCTL_OVER = 0x20,
148 FIFOCTL_DIR = 0x10, 145 FIFOCTL_DIR = 0x10,
149 FIFOCTL_CLR = 0x08, 146 FIFOCTL_CLR = 0x08,
150 FIFOCTL_EMPTY = 0x04, 147 FIFOCTL_EMPTY = 0x04,
@@ -594,9 +591,10 @@ static int fifo_txwait(struct stir_cb *stir, int space)
594{ 591{
595 int err; 592 int err;
596 unsigned long count, status; 593 unsigned long count, status;
594 unsigned long prev_count = 0x1fff;
597 595
598 /* Read FIFO status and count */ 596 /* Read FIFO status and count */
599 for(;;) { 597 for (;; prev_count = count) {
600 err = read_reg(stir, REG_FIFOCTL, stir->fifo_status, 598 err = read_reg(stir, REG_FIFOCTL, stir->fifo_status,
601 FIFO_REGS_SIZE); 599 FIFO_REGS_SIZE);
602 if (unlikely(err != FIFO_REGS_SIZE)) { 600 if (unlikely(err != FIFO_REGS_SIZE)) {
@@ -629,6 +627,10 @@ static int fifo_txwait(struct stir_cb *stir, int space)
629 if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count) 627 if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count)
630 return 0; 628 return 0;
631 629
630 /* queue confused */
631 if (prev_count < count)
632 break;
633
632 /* estimate transfer time for remaining chars */ 634 /* estimate transfer time for remaining chars */
633 msleep((count * 8000) / stir->speed); 635 msleep((count * 8000) / stir->speed);
634 } 636 }
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c
index 232ecba5340f..61e24b7a45a3 100644
--- a/drivers/net/wan/syncppp.c
+++ b/drivers/net/wan/syncppp.c
@@ -107,24 +107,24 @@
107struct ppp_header { 107struct ppp_header {
108 u8 address; 108 u8 address;
109 u8 control; 109 u8 control;
110 u16 protocol; 110 __be16 protocol;
111}; 111};
112#define PPP_HEADER_LEN sizeof (struct ppp_header) 112#define PPP_HEADER_LEN sizeof (struct ppp_header)
113 113
114struct lcp_header { 114struct lcp_header {
115 u8 type; 115 u8 type;
116 u8 ident; 116 u8 ident;
117 u16 len; 117 __be16 len;
118}; 118};
119#define LCP_HEADER_LEN sizeof (struct lcp_header) 119#define LCP_HEADER_LEN sizeof (struct lcp_header)
120 120
121struct cisco_packet { 121struct cisco_packet {
122 u32 type; 122 __be32 type;
123 u32 par1; 123 __be32 par1;
124 u32 par2; 124 __be32 par2;
125 u16 rel; 125 __be16 rel;
126 u16 time0; 126 __be16 time0;
127 u16 time1; 127 __be16 time1;
128}; 128};
129#define CISCO_PACKET_LEN 18 129#define CISCO_PACKET_LEN 18
130#define CISCO_BIG_PACKET_LEN 20 130#define CISCO_BIG_PACKET_LEN 20
@@ -139,7 +139,7 @@ static struct sk_buff_head tx_queue;
139static void sppp_keepalive (unsigned long dummy); 139static void sppp_keepalive (unsigned long dummy);
140static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type, 140static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type,
141 u8 ident, u16 len, void *data); 141 u8 ident, u16 len, void *data);
142static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2); 142static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2);
143static void sppp_lcp_input (struct sppp *sp, struct sk_buff *m); 143static void sppp_lcp_input (struct sppp *sp, struct sk_buff *m);
144static void sppp_cisco_input (struct sppp *sp, struct sk_buff *m); 144static void sppp_cisco_input (struct sppp *sp, struct sk_buff *m);
145static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *m); 145static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *m);
@@ -447,7 +447,7 @@ static void sppp_keepalive (unsigned long dummy)
447 sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ, ++sp->pp_seq, 447 sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ, ++sp->pp_seq,
448 sp->pp_rseq); 448 sp->pp_rseq);
449 else if (sp->lcp.state == LCP_STATE_OPENED) { 449 else if (sp->lcp.state == LCP_STATE_OPENED) {
450 long nmagic = htonl (sp->lcp.magic); 450 __be32 nmagic = htonl (sp->lcp.magic);
451 sp->lcp.echoid = ++sp->pp_seq; 451 sp->lcp.echoid = ++sp->pp_seq;
452 sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REQ, 452 sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REQ,
453 sp->lcp.echoid, 4, &nmagic); 453 sp->lcp.echoid, 4, &nmagic);
@@ -667,7 +667,7 @@ badreq:
667 dev->name, len); 667 dev->name, len);
668 break; 668 break;
669 } 669 }
670 if (ntohl (*(long*)(h+1)) == sp->lcp.magic) { 670 if (ntohl (*(__be32*)(h+1)) == sp->lcp.magic) {
671 /* Line loopback mode detected. */ 671 /* Line loopback mode detected. */
672 printk (KERN_WARNING "%s: loopback\n", dev->name); 672 printk (KERN_WARNING "%s: loopback\n", dev->name);
673 if_down (dev); 673 if_down (dev);
@@ -680,7 +680,7 @@ badreq:
680 sppp_lcp_open (sp); 680 sppp_lcp_open (sp);
681 break; 681 break;
682 } 682 }
683 *(long*)(h+1) = htonl (sp->lcp.magic); 683 *(__be32 *)(h+1) = htonl (sp->lcp.magic);
684 sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REPLY, h->ident, len-4, h+1); 684 sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REPLY, h->ident, len-4, h+1);
685 break; 685 break;
686 case LCP_ECHO_REPLY: 686 case LCP_ECHO_REPLY:
@@ -692,7 +692,7 @@ badreq:
692 dev->name, len); 692 dev->name, len);
693 break; 693 break;
694 } 694 }
695 if (ntohl (*(long*)(h+1)) != sp->lcp.magic) 695 if (ntohl(*(__be32 *)(h+1)) != sp->lcp.magic)
696 sp->pp_alivecnt = 0; 696 sp->pp_alivecnt = 0;
697 break; 697 break;
698 } 698 }
@@ -765,7 +765,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
765 { 765 {
766 struct in_device *in_dev; 766 struct in_device *in_dev;
767 struct in_ifaddr *ifa; 767 struct in_ifaddr *ifa;
768 __be32 addr = 0, mask = ~0; /* FIXME: is the mask correct? */ 768 __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */
769#ifdef CONFIG_INET 769#ifdef CONFIG_INET
770 rcu_read_lock(); 770 rcu_read_lock();
771 if ((in_dev = __in_dev_get_rcu(dev)) != NULL) 771 if ((in_dev = __in_dev_get_rcu(dev)) != NULL)
@@ -782,8 +782,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
782 } 782 }
783 rcu_read_unlock(); 783 rcu_read_unlock();
784#endif 784#endif
785 /* I hope both addr and mask are in the net order */ 785 sppp_cisco_send (sp, CISCO_ADDR_REPLY, ntohl(addr), ntohl(mask));
786 sppp_cisco_send (sp, CISCO_ADDR_REPLY, addr, mask);
787 break; 786 break;
788 } 787 }
789 } 788 }
@@ -844,7 +843,7 @@ static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type,
844 * Send Cisco keepalive packet. 843 * Send Cisco keepalive packet.
845 */ 844 */
846 845
847static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2) 846static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2)
848{ 847{
849 struct ppp_header *h; 848 struct ppp_header *h;
850 struct cisco_packet *ch; 849 struct cisco_packet *ch;
@@ -868,7 +867,7 @@ static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2)
868 ch->type = htonl (type); 867 ch->type = htonl (type);
869 ch->par1 = htonl (par1); 868 ch->par1 = htonl (par1);
870 ch->par2 = htonl (par2); 869 ch->par2 = htonl (par2);
871 ch->rel = -1; 870 ch->rel = htons(0xffff);
872 ch->time0 = htons ((u16) (t >> 16)); 871 ch->time0 = htons ((u16) (t >> 16));
873 ch->time1 = htons ((u16) t); 872 ch->time1 = htons ((u16) t);
874 873