PD#153826 wifi: fix p2p go connect fail issue
authorRongjun Chen <rongjun.chen@amlogic.com>
Wed, 8 Nov 2017 08:30:56 +0000 (16:30 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Wed, 8 Nov 2017 08:30:56 +0000 (16:30 +0800)
Change-Id: Ib04a6a163c8215e535d8c03a507acaa9fd96c019

bcmdhd.1.363.59.144.x.cn/dhd_gpio.c
bcmdhd.1.363.59.144.x.cn/wl_cfg80211.c

index 8b9c66510a2a83696ea822beb20fe439ed528fe5..c29d7710b58f06c7c1dc1a4171c0c350a3bfd336 100644 (file)
@@ -30,6 +30,7 @@ extern int wifi_irq_num(void);
 
 extern u8 *wifi_get_mac(void);
 #ifdef CONFIG_DHD_USE_STATIC_BUF
+extern void *bcmdhd_mem_prealloc(int section, unsigned long size);
 #endif /* CONFIG_DHD_USE_STATIC_BUF */
 
 static int gpio_wl_reg_on = -1; // WL_REG_ON is input pin of WLAN module
@@ -178,17 +179,17 @@ static int dhd_wlan_get_mac_addr(unsigned char *buf)
 #ifdef EXAMPLE_GET_MAC_VER2
        /* EXAMPLE code */
        {
-                       char mac[6] = {0x00,0x11,0x22,0x33,0x44,0xFF};
-                       char macpad[56]= {
-                       0x00,0xaa,0x9c,0x84,0xc7,0xbc,0x9b,0xf6,
-                       0x02,0x33,0xa9,0x4d,0x5c,0xb4,0x0a,0x5d,
-                       0xa8,0xef,0xb0,0xcf,0x8e,0xbf,0x24,0x8a,
-                       0x87,0x0f,0x6f,0x0d,0xeb,0x83,0x6a,0x70,
-                       0x4a,0xeb,0xf6,0xe6,0x3c,0xe7,0x5f,0xfc,
-                       0x0e,0xa7,0xb3,0x0f,0x00,0xe4,0x4a,0xaf,
-                       0x87,0x08,0x16,0x6d,0x3a,0xe3,0xc7,0x80};
-                       bcopy(mac, buf, sizeof(mac));
-                       bcopy(macpad, buf+6, sizeof(macpad));
+               char mac[6] = {0x00,0x11,0x22,0x33,0x44,0xFF};
+               char macpad[56]= {
+               0x00,0xaa,0x9c,0x84,0xc7,0xbc,0x9b,0xf6,
+               0x02,0x33,0xa9,0x4d,0x5c,0xb4,0x0a,0x5d,
+               0xa8,0xef,0xb0,0xcf,0x8e,0xbf,0x24,0x8a,
+               0x87,0x0f,0x6f,0x0d,0xeb,0x83,0x6a,0x70,
+               0x4a,0xeb,0xf6,0xe6,0x3c,0xe7,0x5f,0xfc,
+               0x0e,0xa7,0xb3,0x0f,0x00,0xe4,0x4a,0xaf,
+               0x87,0x08,0x16,0x6d,0x3a,0xe3,0xc7,0x80};
+               bcopy(mac, buf, sizeof(mac));
+               bcopy(macpad, buf+6, sizeof(macpad));
        }
 #endif /* EXAMPLE_GET_MAC_VER2 */
        bcopy((char *)wifi_get_mac(), buf, sizeof(struct ether_addr));
@@ -199,22 +200,6 @@ static int dhd_wlan_get_mac_addr(unsigned char *buf)
 
        return err;
 }
-#ifdef CONFIG_DHD_USE_STATIC_BUF
-extern void *bcmdhd_mem_prealloc(int section, unsigned long size);
-void* bcm_wlan_prealloc(int section, unsigned long size)
-{
-       void *alloc_ptr = NULL;
-       alloc_ptr = bcmdhd_mem_prealloc(section, size);
-       if (alloc_ptr) {
-               printf("success alloc section %d, size %ld\n", section, size);
-               if (size != 0L)
-                       bzero(alloc_ptr, size);
-               return alloc_ptr;
-       }
-       printf("can't alloc section %d\n", section);
-       return NULL;
-}
-#endif
 
 #if !defined(WL_WIRELESS_EXT)
 struct cntry_locales_custom {
@@ -284,7 +269,7 @@ struct wifi_platform_data dhd_wlan_control = {
        .set_carddetect = dhd_wlan_set_carddetect,
        .get_mac_addr   = dhd_wlan_get_mac_addr,
 #ifdef CONFIG_DHD_USE_STATIC_BUF
-       .mem_prealloc   = bcm_wlan_prealloc,
+       .mem_prealloc   = bcmdhd_mem_prealloc,
 #endif /* CONFIG_DHD_USE_STATIC_BUF */
        .get_country_code = dhd_wlan_get_country_code,
 };
index bc997a0e35853424680986dd9540f264048e0860..62be3d39ba3f6dc355c3972b32cccb91793e268d 100644 (file)
@@ -7748,9 +7748,9 @@ static s32 wl_cfg80211_bcn_set_params(
                        memcpy(cfg->hostapd_ssid.SSID, info->ssid, info->ssid_len);
                        cfg->hostapd_ssid.SSID_len = info->ssid_len;
                } else {
-                               /* P2P GO */
+                       /* P2P GO */
                        memset(cfg->p2p->ssid.SSID, 0x00, DOT11_MAX_SSID_LEN);
-                       memcpy(cfg->p2p->ssid.SSID, info->ssid, cfg->p2p->ssid.SSID_len);
+                       memcpy(cfg->p2p->ssid.SSID, info->ssid, info->ssid_len);
                        cfg->p2p->ssid.SSID_len = info->ssid_len;
                }
        }