Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WLAN_STATUS wlanUpdateNetworkAddress(IN P_ADAPTER_T prAdapter)
- {
- const UINT_8 aucZeroMacAddr[] = NULL_MAC_ADDR;
- PARAM_MAC_ADDRESS rMacAddr = {0};
- UINT_32 u4SysTime;
- DEBUGFUNC("wlanUpdateNetworkAddress");
- ASSERT(prAdapter);
- if (kalRetrieveNetworkAddress(prAdapter->prGlueInfo, &rMacAddr) == FALSE || IS_BMCAST_MAC_ADDR(rMacAddr)
- || EQUAL_MAC_ADDR(aucZeroMacAddr, rMacAddr)) {
- /* eFUSE has a valid address, don't do anything */
- if (prAdapter->fgIsEmbbededMacAddrValid == FALSE) {
- #if CFG_SHOW_MACADDR_SOURCE
- DBGLOG(INIT, INFO, "Using dynamically generated MAC address");
- #endif
- /* dynamic generate */
- u4SysTime = (UINT_32) kalGetTimeTick();
- rMacAddr[0] = 0x00;
- rMacAddr[1] = 0x08;
- rMacAddr[2] = 0x22;
- kalMemCopy(&rMacAddr[3], &u4SysTime, 3);
- } else {
- #if CFG_SHOW_MACADDR_SOURCE
- DBGLOG(INIT, INFO, "Using embedded MAC address");
- #endif
- return WLAN_STATUS_SUCCESS;
- }
- } else {
- #if CFG_SHOW_MACADDR_SOURCE
- DBGLOG(INIT, INFO, "Using host-supplied MAC address");
- #endif
- }
- COPY_MAC_ADDR(prAdapter->rWifiVar.aucMacAddress, rMacAddr);
- return WLAN_STATUS_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement