kernel: update to 3.18.71
[openwrt/staging/lynxis.git] / target / linux / generic / pending-3.18 / 190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch
index 0b03963f0af51d613b04ade69670730f834f5a6b..632384d56f4d966af68a0acef92bdd272d062d2d 100644 (file)
@@ -79,21 +79,21 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        /* override ethtool_ops */
        dev->net->ethtool_ops = &cdc_ncm_ethtool_ops;
  
-@@ -958,8 +971,11 @@ static int cdc_ncm_bind(struct usbnet *d
+@@ -956,8 +969,11 @@ static int cdc_ncm_bind(struct usbnet *d
        if (cdc_ncm_select_altsetting(intf) != CDC_NCM_COMM_ALTSETTING_NCM)
                return -ENODEV;
  
 -      /* The NCM data altsetting is fixed */
--      ret = cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM);
+-      return cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM);
 +      /* The NCM data altsetting is fixed, so we hard-coded it.
 +       * Additionally, generic NCM devices are assumed to accept arbitrarily
 +       * placed NDP.
 +       */
-+      ret = cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM, 0);
++      return cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM, 0);
+ }
  
-       /*
-        * We should get an event when network connection is "connected" or
-@@ -990,6 +1006,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm
+ static void cdc_ncm_align_tail(struct sk_buff *skb, size_t modulus, size_t remainder, size_t max)
+@@ -979,6 +995,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm
        struct usb_cdc_ncm_nth16 *nth16 = (void *)skb->data;
        size_t ndpoffset = le16_to_cpu(nth16->wNdpIndex);
  
@@ -108,7 +108,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        /* follow the chain of NDPs, looking for a match */
        while (ndpoffset) {
                ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb->data + ndpoffset);
-@@ -999,7 +1023,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm
+@@ -988,7 +1012,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm
        }
  
        /* align new NDP */
@@ -118,7 +118,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        /* verify that there is room for the NDP and the datagram (reserve) */
        if ((ctx->tx_max - skb->len - reserve) < ctx->max_ndp_size)
-@@ -1012,7 +1037,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm
+@@ -1001,7 +1026,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm
                nth16->wNdpIndex = cpu_to_le16(skb->len);
  
        /* push a new empty NDP */
@@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        ndp16->dwSignature = sign;
        ndp16->wLength = cpu_to_le16(sizeof(struct usb_cdc_ncm_ndp16) + sizeof(struct usb_cdc_ncm_dpe16));
        return ndp16;
-@@ -1027,6 +1056,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev
+@@ -1016,6 +1045,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev
        struct sk_buff *skb_out;
        u16 n = 0, index, ndplen;
        u8 ready2send = 0;
@@ -147,7 +147,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        /* if there is a remaining skb, it gets priority */
        if (skb != NULL) {
-@@ -1081,7 +1119,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev
+@@ -1070,7 +1108,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev
                cdc_ncm_align_tail(skb_out,  ctx->tx_modulus, ctx->tx_remainder, ctx->tx_max);
  
                /* check if we had enough room left for both NDP and frame */
@@ -156,7 +156,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        if (n == 0) {
                                /* won't fit, MTU problem? */
                                dev_kfree_skb_any(skb);
-@@ -1154,6 +1192,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev
+@@ -1143,6 +1181,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev
                /* variables will be reset at next call */
        }