Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vt6656: remove wpahdr from driver.

wpahdr relates to redundant viawget, a proprietary version of wpa supplicant.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Malcolm Priestley and committed by
Greg Kroah-Hartman
14d0fdb3 5743fc81

-147
-29
drivers/staging/vt6656/bssdb.c
··· 882 882 unsigned int uSleepySTACnt = 0; 883 883 unsigned int uNonShortSlotSTACnt = 0; 884 884 unsigned int uLongPreambleSTACnt = 0; 885 - viawget_wpa_header *wpahdr; 886 885 887 886 spin_lock_irq(&pDevice->lock); 888 887 ··· 1099 1100 1100 1101 DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Lost AP beacon [%d] sec, disconnected !\n", pMgmt->sNodeDBTable[0].uInActiveCount); 1101 1102 /* let wpa supplicant know AP may disconnect */ 1102 - if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { 1103 - wpahdr = (viawget_wpa_header *)pDevice->skb->data; 1104 - wpahdr->type = VIAWGET_DISASSOC_MSG; 1105 - wpahdr->resp_ie_len = 0; 1106 - wpahdr->req_ie_len = 0; 1107 - skb_put(pDevice->skb, sizeof(viawget_wpa_header)); 1108 - pDevice->skb->dev = pDevice->wpadev; 1109 - skb_reset_mac_header(pDevice->skb); 1110 - pDevice->skb->pkt_type = PACKET_HOST; 1111 - pDevice->skb->protocol = htons(ETH_P_802_2); 1112 - memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); 1113 - netif_rx(pDevice->skb); 1114 - pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); 1115 - } 1116 1103 { 1117 1104 union iwreq_data wrqu; 1118 1105 memset(&wrqu, 0, sizeof (wrqu)); ··· 1125 1140 pDevice->uAutoReConnectTime = 0; 1126 1141 pDevice->uIsroamingTime = 0; 1127 1142 pDevice->bRoaming = FALSE; 1128 - 1129 - wpahdr = (viawget_wpa_header *)pDevice->skb->data; 1130 - wpahdr->type = VIAWGET_CCKM_ROAM_MSG; 1131 - wpahdr->resp_ie_len = 0; 1132 - wpahdr->req_ie_len = 0; 1133 - skb_put(pDevice->skb, sizeof(viawget_wpa_header)); 1134 - pDevice->skb->dev = pDevice->wpadev; 1135 - skb_reset_mac_header(pDevice->skb); 1136 - pDevice->skb->pkt_type = PACKET_HOST; 1137 - pDevice->skb->protocol = htons(ETH_P_802_2); 1138 - memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); 1139 - netif_rx(pDevice->skb); 1140 - pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); 1141 - 1142 1143 } 1143 1144 else if ((pDevice->bRoaming == FALSE)&&(pDevice->bIsRoaming == TRUE)) { 1144 1145 pDevice->uIsroamingTime++;
-25
drivers/staging/vt6656/dpc.c
··· 818 818 DWORD dwMICKey0 = 0, dwMICKey1 = 0; 819 819 DWORD dwLocalMIC_L = 0; 820 820 DWORD dwLocalMIC_R = 0; 821 - viawget_wpa_header *wpahdr; 822 821 823 822 824 823 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { ··· 887 888 wireless_send_event(pDevice->dev, IWEVMICHAELMICFAILURE, &wrqu, (char *)&ev); 888 889 889 890 } 890 - 891 - 892 - if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { 893 - wpahdr = (viawget_wpa_header *)pDevice->skb->data; 894 - if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && 895 - (pMgmt->eCurrState == WMAC_STATE_ASSOC) && 896 - (*pbyRsr & (RSR_ADDRBROAD | RSR_ADDRMULTI)) == 0) { 897 - //s802_11_Status.Flags = NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR; 898 - wpahdr->type = VIAWGET_PTK_MIC_MSG; 899 - } else { 900 - //s802_11_Status.Flags = NDIS_802_11_AUTH_REQUEST_GROUP_ERROR; 901 - wpahdr->type = VIAWGET_GTK_MIC_MSG; 902 - } 903 - wpahdr->resp_ie_len = 0; 904 - wpahdr->req_ie_len = 0; 905 - skb_put(pDevice->skb, sizeof(viawget_wpa_header)); 906 - pDevice->skb->dev = pDevice->wpadev; 907 - skb_reset_mac_header(pDevice->skb); 908 - pDevice->skb->pkt_type = PACKET_HOST; 909 - pDevice->skb->protocol = htons(ETH_P_802_2); 910 - memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); 911 - netif_rx(pDevice->skb); 912 - return TRUE; 913 - } 914 891 915 892 return FALSE; 916 893
-37
drivers/staging/vt6656/main_usb.c
··· 244 244 unsigned char *dest, 245 245 unsigned char *source); 246 246 247 - static BOOL device_release_WPADEV(PSDevice pDevice); 248 247 249 248 static void usb_device_reset(PSDevice pDevice); 250 249 ··· 630 631 631 632 spin_unlock_irq(&pDevice->lock); 632 633 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n"); 633 - return TRUE; 634 - } 635 - 636 - static BOOL device_release_WPADEV(PSDevice pDevice) 637 - { 638 - viawget_wpa_header *wpahdr; 639 - int ii=0; 640 - // wait_queue_head_t Set_wait; 641 - //send device close to wpa_supplicant layer 642 - if (pDevice->bWPADEVUp==TRUE) { 643 - wpahdr = (viawget_wpa_header *)pDevice->skb->data; 644 - wpahdr->type = VIAWGET_DEVICECLOSE_MSG; 645 - wpahdr->resp_ie_len = 0; 646 - wpahdr->req_ie_len = 0; 647 - skb_put(pDevice->skb, sizeof(viawget_wpa_header)); 648 - pDevice->skb->dev = pDevice->wpadev; 649 - skb_reset_mac_header(pDevice->skb); 650 - pDevice->skb->pkt_type = PACKET_HOST; 651 - pDevice->skb->protocol = htons(ETH_P_802_2); 652 - memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); 653 - netif_rx(pDevice->skb); 654 - pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); 655 - 656 - //wait release WPADEV 657 - // init_waitqueue_head(&Set_wait); 658 - // wait_event_timeout(Set_wait, ((pDevice->wpadev==NULL)&&(pDevice->skb == NULL)),5*HZ); //1s wait 659 - while(pDevice->bWPADEVUp==TRUE) { 660 - set_current_state(TASK_UNINTERRUPTIBLE); 661 - schedule_timeout (HZ/20); //wait 50ms 662 - ii++; 663 - if(ii>20) 664 - break; 665 - } 666 - } 667 634 return TRUE; 668 635 } 669 636 ··· 1108 1143 mdelay(30); 1109 1144 } 1110 1145 1111 - device_release_WPADEV(pDevice); 1112 1146 1113 1147 memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); 1114 1148 pMgmt->bShareKeyAlgorithm = FALSE; ··· 1180 1216 wireless_send_event(device->dev, IWEVCUSTOM, &req, NULL); 1181 1217 } 1182 1218 1183 - device_release_WPADEV(device); 1184 1219 1185 1220 usb_set_intfdata(intf, NULL); 1186 1221 usb_put_dev(interface_to_usbdev(intf));
-56
drivers/staging/vt6656/wmgr.c
··· 925 925 WLAN_FR_ASSOCRESP sFrame; 926 926 PWLAN_IE_SSID pItemSSID; 927 927 PBYTE pbyIEs; 928 - viawget_wpa_header *wpahdr; 929 928 930 929 931 930 ··· 972 973 DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Link with AP(SSID): %s\n", pItemSSID->abySSID); 973 974 pDevice->bLinkPass = TRUE; 974 975 ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER); 975 - if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { 976 - if(skb_tailroom(pDevice->skb) <(sizeof(viawget_wpa_header)+pMgmt->sAssocInfo.AssocInfo.ResponseIELength+ 977 - pMgmt->sAssocInfo.AssocInfo.RequestIELength)) { //data room not enough 978 - dev_kfree_skb(pDevice->skb); 979 - pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); 980 - } 981 - wpahdr = (viawget_wpa_header *)pDevice->skb->data; 982 - wpahdr->type = VIAWGET_ASSOC_MSG; 983 - wpahdr->resp_ie_len = pMgmt->sAssocInfo.AssocInfo.ResponseIELength; 984 - wpahdr->req_ie_len = pMgmt->sAssocInfo.AssocInfo.RequestIELength; 985 - memcpy(pDevice->skb->data + sizeof(viawget_wpa_header), pMgmt->sAssocInfo.abyIEs, wpahdr->req_ie_len); 986 - memcpy(pDevice->skb->data + sizeof(viawget_wpa_header) + wpahdr->req_ie_len, 987 - pbyIEs, 988 - wpahdr->resp_ie_len 989 - ); 990 - skb_put(pDevice->skb, sizeof(viawget_wpa_header) + wpahdr->resp_ie_len + wpahdr->req_ie_len); 991 - pDevice->skb->dev = pDevice->wpadev; 992 - skb_reset_mac_header(pDevice->skb); 993 - pDevice->skb->pkt_type = PACKET_HOST; 994 - pDevice->skb->protocol = htons(ETH_P_802_2); 995 - memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); 996 - netif_rx(pDevice->skb); 997 - pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); 998 - } 999 976 1000 977 //if(pDevice->bWPASuppWextEnabled == TRUE) 1001 978 { ··· 1558 1583 WLAN_FR_DISASSOC sFrame; 1559 1584 unsigned int uNodeIndex = 0; 1560 1585 CMD_STATUS CmdStatus; 1561 - viawget_wpa_header *wpahdr; 1562 1586 1563 1587 if ( pMgmt->eCurrMode == WMAC_MODE_ESS_AP ){ 1564 1588 // if is acting an AP.. ··· 1578 1604 DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "AP disassociated me, reason=%d.\n", cpu_to_le16(*(sFrame.pwReason))); 1579 1605 1580 1606 pDevice->fWPA_Authened = FALSE; 1581 - if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { 1582 - wpahdr = (viawget_wpa_header *)pDevice->skb->data; 1583 - wpahdr->type = VIAWGET_DISASSOC_MSG; 1584 - wpahdr->resp_ie_len = 0; 1585 - wpahdr->req_ie_len = 0; 1586 - skb_put(pDevice->skb, sizeof(viawget_wpa_header)); 1587 - pDevice->skb->dev = pDevice->wpadev; 1588 - skb_reset_mac_header(pDevice->skb); 1589 - pDevice->skb->pkt_type = PACKET_HOST; 1590 - pDevice->skb->protocol = htons(ETH_P_802_2); 1591 - memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); 1592 - netif_rx(pDevice->skb); 1593 - pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); 1594 - } 1595 1607 1596 1608 //TODO: do something let upper layer know or 1597 1609 //try to send associate packet again because of inactivity timeout ··· 1630 1670 { 1631 1671 WLAN_FR_DEAUTHEN sFrame; 1632 1672 unsigned int uNodeIndex = 0; 1633 - viawget_wpa_header *wpahdr; 1634 1673 1635 1674 1636 1675 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP ){ ··· 1664 1705 ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); 1665 1706 } 1666 1707 } 1667 - 1668 - if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { 1669 - wpahdr = (viawget_wpa_header *)pDevice->skb->data; 1670 - wpahdr->type = VIAWGET_DISASSOC_MSG; 1671 - wpahdr->resp_ie_len = 0; 1672 - wpahdr->req_ie_len = 0; 1673 - skb_put(pDevice->skb, sizeof(viawget_wpa_header)); 1674 - pDevice->skb->dev = pDevice->wpadev; 1675 - skb_reset_mac_header(pDevice->skb); 1676 - pDevice->skb->pkt_type = PACKET_HOST; 1677 - pDevice->skb->protocol = htons(ETH_P_802_2); 1678 - memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); 1679 - netif_rx(pDevice->skb); 1680 - pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); 1681 - } 1682 1708 1683 1709 // if(pDevice->bWPASuppWextEnabled == TRUE) 1684 1710 {