diff options
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r-- | drivers/net/usb/usbnet.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 8494bb53ebdc..dd10d5817d2a 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -14,8 +14,7 @@ | |||
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | 15 | * |
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | 18 | */ |
20 | 19 | ||
21 | /* | 20 | /* |
@@ -543,17 +542,19 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | |||
543 | } | 542 | } |
544 | // else network stack removes extra byte if we forced a short packet | 543 | // else network stack removes extra byte if we forced a short packet |
545 | 544 | ||
546 | if (skb->len) { | 545 | /* all data was already cloned from skb inside the driver */ |
547 | /* all data was already cloned from skb inside the driver */ | 546 | if (dev->driver_info->flags & FLAG_MULTI_PACKET) |
548 | if (dev->driver_info->flags & FLAG_MULTI_PACKET) | 547 | goto done; |
549 | dev_kfree_skb_any(skb); | 548 | |
550 | else | 549 | if (skb->len < ETH_HLEN) { |
551 | usbnet_skb_return(dev, skb); | 550 | dev->net->stats.rx_errors++; |
551 | dev->net->stats.rx_length_errors++; | ||
552 | netif_dbg(dev, rx_err, dev->net, "rx length %d\n", skb->len); | ||
553 | } else { | ||
554 | usbnet_skb_return(dev, skb); | ||
552 | return; | 555 | return; |
553 | } | 556 | } |
554 | 557 | ||
555 | netif_dbg(dev, rx_err, dev->net, "drop\n"); | ||
556 | dev->net->stats.rx_errors++; | ||
557 | done: | 558 | done: |
558 | skb_queue_tail(&dev->done, skb); | 559 | skb_queue_tail(&dev->done, skb); |
559 | } | 560 | } |
@@ -575,13 +576,6 @@ static void rx_complete (struct urb *urb) | |||
575 | switch (urb_status) { | 576 | switch (urb_status) { |
576 | /* success */ | 577 | /* success */ |
577 | case 0: | 578 | case 0: |
578 | if (skb->len < dev->net->hard_header_len) { | ||
579 | state = rx_cleanup; | ||
580 | dev->net->stats.rx_errors++; | ||
581 | dev->net->stats.rx_length_errors++; | ||
582 | netif_dbg(dev, rx_err, dev->net, | ||
583 | "rx length %d\n", skb->len); | ||
584 | } | ||
585 | break; | 579 | break; |
586 | 580 | ||
587 | /* stalls need manual reset. this is rare ... except that | 581 | /* stalls need manual reset. this is rare ... except that |
@@ -1245,7 +1239,7 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) | |||
1245 | return -ENOMEM; | 1239 | return -ENOMEM; |
1246 | 1240 | ||
1247 | urb->num_sgs = num_sgs; | 1241 | urb->num_sgs = num_sgs; |
1248 | sg_init_table(urb->sg, urb->num_sgs); | 1242 | sg_init_table(urb->sg, urb->num_sgs + 1); |
1249 | 1243 | ||
1250 | sg_set_buf(&urb->sg[s++], skb->data, skb_headlen(skb)); | 1244 | sg_set_buf(&urb->sg[s++], skb->data, skb_headlen(skb)); |
1251 | total_len += skb_headlen(skb); | 1245 | total_len += skb_headlen(skb); |