Change-Id: I4eea5e32a063bca45671c8a70d48b26bb2e7bd44
Signed-off-by: zzc <zzc@rock-chips.com>
return -1;
}
EXPORT_SYMBOL(rk_vendor_register);
+
+bool is_rk_vendor_ready(void)
+{
+ if (_vendor_read && _vendor_write)
+ return true;
+ return false;
+}
+EXPORT_SYMBOL(is_rk_vendor_ready);
int rk_vendor_read(u32 id, void *pbuf, u32 size);
int rk_vendor_write(u32 id, void *pbuf, u32 size);
int rk_vendor_register(void *read, void *write);
+bool is_rk_vendor_ready(void);
#endif
static int get_wifi_addr_vendor(unsigned char *addr)
{
int ret;
+ int count = 5;
+ while (count-- > 0) {
+ if (is_rk_vendor_ready())
+ break;
+ /* sleep 500ms wait rk vendor driver ready */
+ msleep(500);
+ }
ret = rk_vendor_read(WIFI_MAC_ID, addr, 6);
if (ret != 6 || is_zero_ether_addr(addr)) {
LOG("%s: rk_vendor_read wifi mac address failed (%d)\n",