wifi: add on board mac patch
authorRongjun Chen <rongjun.chen@amlogic.com>
Fri, 20 Jan 2017 08:06:48 +0000 (16:06 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Fri, 20 Jan 2017 11:55:34 +0000 (19:55 +0800)
Change-Id: I067f69cc6f6121fb51d414cc91969ce881c453f7

bcmdhd.1.363.59.144.x.cn/Makefile
bcmdhd.1.363.59.144.x.cn/dhd_gpio.c
bcmdhd_1_201_59_x/Makefile
bcmdhd_1_201_59_x/dhd_gpio.c

index 752199a1952a6c5260fc7b51082c45bee403d61c..1fc464cb032ed7c3dcfa48d9fbe6aaf0ba04dabd 100644 (file)
@@ -14,7 +14,7 @@ DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER -DSDTEST       \
        -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT -DSUPPORT_PM2_ONLY             \
        -DKEEP_ALIVE -DPKT_FILTER_SUPPORT -DPNO_SUPPORT -DDHDTCPACK_SUPPRESS  \
        -DDHD_DONOT_FORWARD_BCMEVENT_AS_NETWORK_PKT -DRXFRAME_THREAD          \
-       -DENABLE_INSMOD_NO_FW_LOAD                                            \
+       -DENABLE_INSMOD_NO_FW_LOAD -DGET_CUSTOM_MAC_ENABLE                     \
        -I$(src) -I$(src)/include
 
 DHDOFILES = aiutils.o siutils.o sbutils.o bcmutils.o bcmwifi_channels.o \
index 687edd7d703afa3e8f25fc0916290b6ca0614a95..ea105485c3b5477cec17251acea46cf91c01298d 100644 (file)
@@ -27,6 +27,7 @@ extern int wifi_irq_num(void);
 #endif
 #endif
 
+extern u8 *wifi_get_mac(void);
 #ifndef CUSTOMER_HW_AMLOGIC
 #define WL_REG_ON 0 // WL_REG_ON is the input pin of WLAN module
 #define WL_HOST_WAKE 0 // WL_HOST_WAKE is output pin of WLAN module
@@ -185,7 +186,11 @@ int bcm_wlan_get_mac_address(unsigned char *buf)
                bcopy((char *)&ea_example, buf, sizeof(struct ether_addr));
        }
 #endif /* EXAMPLE_GET_MAC */
-
+       bcopy((char *)wifi_get_mac(), buf, sizeof(struct ether_addr));
+       if (buf[0] == 0xff) {
+               printf("custom wifi mac is not set\n");
+               err = -1;
+       }
        return err;
 }
 
index 9e37a5a0107f20fd0d4bd3ebd82dd1305fec2145..bd92d25353a3891b2f07308de8c3e5b8622fcd2b 100644 (file)
@@ -15,7 +15,7 @@ DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER -DSDTEST       \
        -DKEEP_ALIVE -DPKT_FILTER_SUPPORT -DPNO_SUPPORT -DDHDTCPACK_SUPPRESS  \
        -DDHD_DONOT_FORWARD_BCMEVENT_AS_NETWORK_PKT -DRXFRAME_THREAD          \
        -DSWTXGLOM                                                            \
-       -DENABLE_INSMOD_NO_FW_LOAD                                            \
+       -DENABLE_INSMOD_NO_FW_LOAD -DGET_CUSTOM_MAC_ENABLE                   \
        -I$(src) -I$(src)/include
 
 DHDOFILES = aiutils.o siutils.o sbutils.o bcmutils.o bcmwifi_channels.o \
index cceb9211f33aca1e3d7a88db296e570cb1708f03..aee2b3b0f9ff0e296edb05b1074c37d1daf73005 100644 (file)
@@ -18,6 +18,7 @@ extern int wifi_irq_num(void);
 #endif
 #endif
 
+extern u8 *wifi_get_mac(void);
 struct wifi_platform_data dhd_wlan_control = {0};
 
 #ifdef CUSTOMER_OOB
@@ -128,7 +129,11 @@ int bcm_wlan_get_mac_address(unsigned char *buf)
                bcopy((char *)&ea_example, buf, sizeof(struct ether_addr));
        }
 #endif /* EXAMPLE_GET_MAC */
-
+       bcopy((char *)wifi_get_mac(), buf, sizeof(struct ether_addr));
+       if (buf[0] == 0xff) {
+               printf("custom wifi mac is not set\n");
+               err = -1;
+       }
        return err;
 }