Advertisement
Guest User

Untitled

a guest
Sep 4th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. WLAN_STATUS wlanUpdateNetworkAddress(IN P_ADAPTER_T prAdapter)
  2. {
  3. const UINT_8 aucZeroMacAddr[] = NULL_MAC_ADDR;
  4. PARAM_MAC_ADDRESS rMacAddr = {0};
  5. UINT_32 u4SysTime;
  6.  
  7. DEBUGFUNC("wlanUpdateNetworkAddress");
  8.  
  9. ASSERT(prAdapter);
  10.  
  11. if (kalRetrieveNetworkAddress(prAdapter->prGlueInfo, &rMacAddr) == FALSE || IS_BMCAST_MAC_ADDR(rMacAddr)
  12. || EQUAL_MAC_ADDR(aucZeroMacAddr, rMacAddr)) {
  13. /* eFUSE has a valid address, don't do anything */
  14. if (prAdapter->fgIsEmbbededMacAddrValid == FALSE) {
  15. #if CFG_SHOW_MACADDR_SOURCE
  16. DBGLOG(INIT, INFO, "Using dynamically generated MAC address");
  17. #endif
  18. /* dynamic generate */
  19. u4SysTime = (UINT_32) kalGetTimeTick();
  20.  
  21. rMacAddr[0] = 0x00;
  22. rMacAddr[1] = 0x08;
  23. rMacAddr[2] = 0x22;
  24. kalMemCopy(&rMacAddr[3], &u4SysTime, 3);
  25. } else {
  26. #if CFG_SHOW_MACADDR_SOURCE
  27. DBGLOG(INIT, INFO, "Using embedded MAC address");
  28. #endif
  29. return WLAN_STATUS_SUCCESS;
  30. }
  31.  
  32. } else {
  33. #if CFG_SHOW_MACADDR_SOURCE
  34. DBGLOG(INIT, INFO, "Using host-supplied MAC address");
  35. #endif
  36. }
  37.  
  38. COPY_MAC_ADDR(prAdapter->rWifiVar.aucMacAddress, rMacAddr);
  39.  
  40. return WLAN_STATUS_SUCCESS;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement