diff options
| -rw-r--r-- | drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 | ||||
| -rw-r--r-- | drivers/staging/brcm80211/include/bcmutils.h | 7 | ||||
| -rw-r--r-- | drivers/staging/brcm80211/util/bcmutils.c | 66 |
3 files changed, 0 insertions, 77 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index e2bc13d66c71..e5357875661f 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c | |||
| @@ -1039,10 +1039,6 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, void *pktbuf) | |||
| 1039 | atomic_inc(&dhd->pend_8021x_cnt); | 1039 | atomic_inc(&dhd->pend_8021x_cnt); |
| 1040 | } | 1040 | } |
| 1041 | 1041 | ||
| 1042 | /* Look into the packet and update the packet priority */ | ||
| 1043 | if ((PKTPRIO(pktbuf) == 0)) | ||
| 1044 | pktsetprio(pktbuf, false); | ||
| 1045 | |||
| 1046 | /* If the protocol uses a data header, apply it */ | 1042 | /* If the protocol uses a data header, apply it */ |
| 1047 | dhd_prot_hdrpush(dhdp, ifidx, pktbuf); | 1043 | dhd_prot_hdrpush(dhdp, ifidx, pktbuf); |
| 1048 | 1044 | ||
diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h index 8e4d7a490751..b53315981be0 100644 --- a/drivers/staging/brcm80211/include/bcmutils.h +++ b/drivers/staging/brcm80211/include/bcmutils.h | |||
| @@ -155,13 +155,6 @@ | |||
| 155 | extern uint pktsegcnt(osl_t *osh, void *p); | 155 | extern uint pktsegcnt(osl_t *osh, void *p); |
| 156 | extern uint pkttotlen(osl_t *osh, void *p); | 156 | extern uint pkttotlen(osl_t *osh, void *p); |
| 157 | 157 | ||
| 158 | /* Get priority from a packet and pass it back in scb (or equiv) */ | ||
| 159 | extern uint pktsetprio(void *pkt, bool update_vtag); | ||
| 160 | #define PKTPRIO_VDSCP 0x100 /* DSCP prio found after VLAN tag */ | ||
| 161 | #define PKTPRIO_VLAN 0x200 /* VLAN prio found */ | ||
| 162 | #define PKTPRIO_UPD 0x400 /* DSCP used to update VLAN prio */ | ||
| 163 | #define PKTPRIO_DSCP 0x800 /* DSCP prio found */ | ||
| 164 | |||
| 165 | /* ethernet address */ | 158 | /* ethernet address */ |
| 166 | extern int bcm_ether_atoe(char *p, struct ether_addr *ea); | 159 | extern int bcm_ether_atoe(char *p, struct ether_addr *ea); |
| 167 | 160 | ||
diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c index 7ac64b6c00f6..1fa176f6beb4 100644 --- a/drivers/staging/brcm80211/util/bcmutils.c +++ b/drivers/staging/brcm80211/util/bcmutils.c | |||
| @@ -418,72 +418,6 @@ void prpkt(const char *msg, osl_t *osh, void *p0) | |||
| 418 | } | 418 | } |
| 419 | #endif /* defined(BCMDBG) */ | 419 | #endif /* defined(BCMDBG) */ |
| 420 | 420 | ||
| 421 | /* Takes an Ethernet frame and sets out-of-bound PKTPRIO. | ||
| 422 | * Also updates the inplace vlan tag if requested. | ||
| 423 | * For debugging, it returns an indication of what it did. | ||
| 424 | */ | ||
| 425 | uint pktsetprio(void *pkt, bool update_vtag) | ||
| 426 | { | ||
| 427 | struct ether_header *eh; | ||
| 428 | struct ethervlan_header *evh; | ||
| 429 | u8 *pktdata; | ||
| 430 | int priority = 0; | ||
| 431 | int rc = 0; | ||
| 432 | |||
| 433 | pktdata = (u8 *) PKTDATA(pkt); | ||
| 434 | ASSERT(IS_ALIGNED((unsigned long)pktdata, sizeof(u16))); | ||
| 435 | |||
| 436 | eh = (struct ether_header *)pktdata; | ||
| 437 | |||
| 438 | if (ntoh16(eh->ether_type) == ETHER_TYPE_8021Q) { | ||
| 439 | u16 vlan_tag; | ||
| 440 | int vlan_prio, dscp_prio = 0; | ||
| 441 | |||
| 442 | evh = (struct ethervlan_header *)eh; | ||
| 443 | |||
| 444 | vlan_tag = ntoh16(evh->vlan_tag); | ||
| 445 | vlan_prio = (int)(vlan_tag >> VLAN_PRI_SHIFT) & VLAN_PRI_MASK; | ||
| 446 | |||
| 447 | if (ntoh16(evh->ether_type) == ETHER_TYPE_IP) { | ||
| 448 | u8 *ip_body = | ||
| 449 | pktdata + sizeof(struct ethervlan_header); | ||
| 450 | u8 tos_tc = IP_TOS(ip_body); | ||
| 451 | dscp_prio = (int)(tos_tc >> IPV4_TOS_PREC_SHIFT); | ||
| 452 | } | ||
| 453 | |||
| 454 | /* DSCP priority gets precedence over 802.1P (vlan tag) */ | ||
| 455 | if (dscp_prio != 0) { | ||
| 456 | priority = dscp_prio; | ||
| 457 | rc |= PKTPRIO_VDSCP; | ||
| 458 | } else { | ||
| 459 | priority = vlan_prio; | ||
| 460 | rc |= PKTPRIO_VLAN; | ||
| 461 | } | ||
| 462 | /* | ||
| 463 | * If the DSCP priority is not the same as the VLAN priority, | ||
| 464 | * then overwrite the priority field in the vlan tag, with the | ||
| 465 | * DSCP priority value. This is required for Linux APs because | ||
| 466 | * the VLAN driver on Linux, overwrites the skb->priority field | ||
| 467 | * with the priority value in the vlan tag | ||
| 468 | */ | ||
| 469 | if (update_vtag && (priority != vlan_prio)) { | ||
| 470 | vlan_tag &= ~(VLAN_PRI_MASK << VLAN_PRI_SHIFT); | ||
| 471 | vlan_tag |= (u16) priority << VLAN_PRI_SHIFT; | ||
| 472 | evh->vlan_tag = hton16(vlan_tag); | ||
| 473 | rc |= PKTPRIO_UPD; | ||
| 474 | } | ||
| 475 | } else if (ntoh16(eh->ether_type) == ETHER_TYPE_IP) { | ||
| 476 | u8 *ip_body = pktdata + sizeof(struct ether_header); | ||
| 477 | u8 tos_tc = IP_TOS(ip_body); | ||
| 478 | priority = (int)(tos_tc >> IPV4_TOS_PREC_SHIFT); | ||
| 479 | rc |= PKTPRIO_DSCP; | ||
| 480 | } | ||
| 481 | |||
| 482 | ASSERT(priority >= 0 && priority <= MAXPRIO); | ||
| 483 | PKTSETPRIO(pkt, priority); | ||
| 484 | return rc | priority; | ||
| 485 | } | ||
| 486 | |||
| 487 | static char bcm_undeferrstr[BCME_STRLEN]; | 421 | static char bcm_undeferrstr[BCME_STRLEN]; |
| 488 | 422 | ||
| 489 | static const char *bcmerrorstrtable[] = BCMERRSTRINGTABLE; | 423 | static const char *bcmerrorstrtable[] = BCMERRSTRINGTABLE; |
