aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2010-12-14 10:24:08 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-16 17:43:14 -0500
commit55508d601dab7df5cbcc7a63f4be8620eface204 (patch)
tree346f30fae9c726d2e73aba2e37ce1e4a31dcea8c /drivers/net/usb
parent04fb451eff978ca059399eab83d5594b073caf6f (diff)
net: Use skb_checksum_start_offset()
Replace skb->csum_start - skb_headroom(skb) with skb_checksum_start_offset(). Note for usb/smsc95xx: skb->data - skb->head == skb_headroom(skb). Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/smsc95xx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 65cb1abfbe57..bc86f4b6ecc2 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1163,9 +1163,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
1163 1163
1164static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb) 1164static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb)
1165{ 1165{
1166 int len = skb->data - skb->head; 1166 u16 low_16 = (u16)skb_checksum_start_offset(skb);
1167 u16 high_16 = (u16)(skb->csum_offset + skb->csum_start - len); 1167 u16 high_16 = low_16 + skb->csum_offset;
1168 u16 low_16 = (u16)(skb->csum_start - len);
1169 return (high_16 << 16) | low_16; 1168 return (high_16 << 16) | low_16;
1170} 1169}
1171 1170
@@ -1193,7 +1192,7 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
1193 if (skb->len <= 45) { 1192 if (skb->len <= 45) {
1194 /* workaround - hardware tx checksum does not work 1193 /* workaround - hardware tx checksum does not work
1195 * properly with extremely small packets */ 1194 * properly with extremely small packets */
1196 long csstart = skb->csum_start - skb_headroom(skb); 1195 long csstart = skb_checksum_start_offset(skb);
1197 __wsum calc = csum_partial(skb->data + csstart, 1196 __wsum calc = csum_partial(skb->data + csstart,
1198 skb->len - csstart, 0); 1197 skb->len - csstart, 0);
1199 *((__sum16 *)(skb->data + csstart 1198 *((__sum16 *)(skb->data + csstart