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

staging: rtl8188eu: core: rtw_xmit: Use macros instead of constants

Replace the 0x888e with ETH_P_PAE and 0x0806 with ETH_P_ARP.
These macros can be found in drivers/staging/rtl8192e/rtllib.h

Hexadecimal numbers are not case sensitive,
therefore 0x888e is equal with 0x888E.

The modifications improve the readability of the code.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Georgiana Rodica Chelu and committed by
Greg Kroah-Hartman
7b170bac 7d7be350

+7 -7
+6 -6
drivers/staging/rtl8188eu/core/rtw_xmit.c
··· 402 402 _rtw_pktfile_read(ppktfile, (u8 *)&ip_hdr, sizeof(ip_hdr)); 403 403 /* user_prio = (ntohs(ip_hdr.tos) >> 5) & 0x3; */ 404 404 user_prio = ip_hdr.tos >> 5; 405 - } else if (pattrib->ether_type == 0x888e) { 405 + } else if (pattrib->ether_type == ETH_P_PAE) { 406 406 /* "When priority processing of data frames is supported, */ 407 407 /* a STA's SME should send EAPOL-Key frames at the highest priority." */ 408 408 user_prio = 7; ··· 469 469 } 470 470 } 471 471 } 472 - } else if (pattrib->ether_type == 0x888e) { 472 + } else if (pattrib->ether_type == ETH_P_PAE) { 473 473 DBG_88E_LEVEL(_drv_info_, "send eapol packet\n"); 474 474 } 475 475 476 - if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1)) 476 + if ((pattrib->ether_type == ETH_P_PAE) || (pattrib->dhcp_pkt == 1)) 477 477 rtw_set_scan_deny(padapter, 3000); 478 478 479 479 /* If EAPOL , ARP , OR DHCP packet, driver must be in active mode. */ 480 - if ((pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1)) 480 + if ((pattrib->ether_type == ETH_P_ARP) || (pattrib->ether_type == ETH_P_PAE) || (pattrib->dhcp_pkt == 1)) 481 481 rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1); 482 482 483 483 bmcast = IS_MCAST(pattrib->ra); ··· 531 531 532 532 pattrib->encrypt = 0; 533 533 534 - if ((pattrib->ether_type != 0x888e) && !check_fwstate(pmlmepriv, WIFI_MP_STATE)) { 535 - RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\npsta->ieee8021x_blocked == true, pattrib->ether_type(%.4x) != 0x888e\n", pattrib->ether_type)); 534 + if ((pattrib->ether_type != ETH_P_PAE) && !check_fwstate(pmlmepriv, WIFI_MP_STATE)) { 535 + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\npsta->ieee8021x_blocked == true, pattrib->ether_type(%.4x) != ETH_P_PAE\n", pattrib->ether_type)); 536 536 res = _FAIL; 537 537 goto exit; 538 538 }
+1 -1
drivers/staging/rtl8192e/rtllib.h
··· 521 521 }; 522 522 523 523 #ifndef ETH_P_PAE 524 - #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 524 + #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 525 525 #define ETH_P_IP 0x0800 /* Internet Protocol packet */ 526 526 #define ETH_P_ARP 0x0806 /* Address Resolution packet */ 527 527 #endif /* ETH_P_PAE */