]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / staging / brcm80211 / brcmfmac / dhd_cdc.c
index bcbaac9bcdcc8af209b28a10463dd2710679efdb..b7b527f5024c5baf593242bac458071c1c8a6324 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/netdevice.h>
 #include <bcmdefs.h>
 #include <osl.h>
 
@@ -297,6 +298,15 @@ done:
        return ret;
 }
 
+#define PKTSUMNEEDED(skb) \
+               (((struct sk_buff *)(skb))->ip_summed == CHECKSUM_PARTIAL)
+#define PKTSETSUMGOOD(skb, x) \
+               (((struct sk_buff *)(skb))->ip_summed = \
+               ((x) ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE))
+
+/* PKTSETSUMNEEDED and PKTSUMGOOD are not possible because
+       skb->ip_summed is overloaded */
+
 int
 dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
                  void *params, int plen, void *arg, int len, bool set)
@@ -309,7 +319,7 @@ void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
        bcm_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
 }
 
-void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *pktbuf)
+void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
 {
 #ifdef BDC
        struct bdc_header *h;
@@ -320,33 +330,33 @@ void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *pktbuf)
 #ifdef BDC
        /* Push BDC header used to convey priority for buses that don't */
 
-       PKTPUSH(pktbuf, BDC_HEADER_LEN);
+       skb_push(pktbuf, BDC_HEADER_LEN);
 
-       h = (struct bdc_header *)PKTDATA(pktbuf);
+       h = (struct bdc_header *)(pktbuf->data);
 
        h->flags = (BDC_PROTO_VER << BDC_FLAG_VER_SHIFT);
        if (PKTSUMNEEDED(pktbuf))
                h->flags |= BDC_FLAG_SUM_NEEDED;
 
-       h->priority = (PKTPRIO(pktbuf) & BDC_PRIORITY_MASK);
+       h->priority = (pktbuf->priority & BDC_PRIORITY_MASK);
        h->flags2 = 0;
        h->rssi = 0;
 #endif                         /* BDC */
        BDC_SET_IF_IDX(h, ifidx);
 }
 
-bool dhd_proto_fcinfo(dhd_pub_t *dhd, void *pktbuf, u8 * fcbits)
+bool dhd_proto_fcinfo(dhd_pub_t *dhd, struct sk_buff *pktbuf, u8 * fcbits)
 {
 #ifdef BDC
        struct bdc_header *h;
 
-       if (PKTLEN(pktbuf) < BDC_HEADER_LEN) {
+       if (pktbuf->len < BDC_HEADER_LEN) {
                DHD_ERROR(("%s: rx data too short (%d < %d)\n",
-                          __func__, PKTLEN(pktbuf), BDC_HEADER_LEN));
+                          __func__, pktbuf->len, BDC_HEADER_LEN));
                return BCME_ERROR;
        }
 
-       h = (struct bdc_header *)PKTDATA(pktbuf);
+       h = (struct bdc_header *)(pktbuf->data);
 
        *fcbits = h->priority >> BDC_PRIORITY_FC_SHIFT;
        if ((h->flags2 & BDC_FLAG2_FC_FLAG) == BDC_FLAG2_FC_FLAG)
@@ -355,7 +365,7 @@ bool dhd_proto_fcinfo(dhd_pub_t *dhd, void *pktbuf, u8 * fcbits)
        return false;
 }
 
-int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, void *pktbuf)
+int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
 {
 #ifdef BDC
        struct bdc_header *h;
@@ -366,13 +376,13 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, void *pktbuf)
 #ifdef BDC
        /* Pop BDC header used to convey priority for buses that don't */
 
-       if (PKTLEN(pktbuf) < BDC_HEADER_LEN) {
+       if (pktbuf->len < BDC_HEADER_LEN) {
                DHD_ERROR(("%s: rx data too short (%d < %d)\n", __func__,
-                          PKTLEN(pktbuf), BDC_HEADER_LEN));
+                          pktbuf->len, BDC_HEADER_LEN));
                return BCME_ERROR;
        }
 
-       h = (struct bdc_header *)PKTDATA(pktbuf);
+       h = (struct bdc_header *)(pktbuf->data);
 
        *ifidx = BDC_GET_IF_IDX(h);
        if (*ifidx >= DHD_MAX_IFS) {
@@ -395,9 +405,9 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, void *pktbuf)
                PKTSETSUMGOOD(pktbuf, true);
        }
 
-       PKTSETPRIO(pktbuf, (h->priority & BDC_PRIORITY_MASK));
+       pktbuf->priority = h->priority & BDC_PRIORITY_MASK;
 
-       PKTPULL(pktbuf, BDC_HEADER_LEN);
+       skb_pull(pktbuf, BDC_HEADER_LEN);
 #endif                         /* BDC */
 
        return 0;
@@ -467,7 +477,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
                dhd_os_proto_unblock(dhd);
                return ret;
        }
-       memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN);
+       memcpy(dhd->mac.octet, buf, ETH_ALEN);
 
        dhd_os_proto_unblock(dhd);