[9609][7885] [7872] wlbt: Update skb length in roam vendor event
authorPragya Gupta <pragya.gupta@samsung.com>
Thu, 12 Jul 2018 07:02:06 +0000 (12:32 +0530)
committerWanhyuk Seo <wan_hyuk.seo@samsung.com>
Tue, 24 Jul 2018 09:53:47 +0000 (18:53 +0900)
skb length updated for roam vendor event

SCSC-Bug-Id: SSB-41838

Change-Id: Ifa44d7062ccdb723dfa4b14e45713c9baaffe1a4
Signed-off-by: Pragya Gupta <pragya.gupta@samsung.com>
drivers/net/wireless/scsc/rx.c

index c206f67b47293311f8b5ad7aac482e2f54908b97..e8e1016864a2053525f9165ae44f63002257474e 100755 (executable)
@@ -779,14 +779,10 @@ enum slsi_wlan_vendor_attr_roam_auth {
        SLSI_WLAN_VENDOR_ATTR_ROAM_AUTH_AFTER_LAST - 1
 };
 
-int slsi_send_roam_vendor_event(struct slsi_dev *sdev,
-                               const u8 *bssid,
-                               const u8 *req_ie, size_t req_ie_len,
-                               const u8 *resp_ie, size_t resp_ie_len,
-                               const u8 *beacon_ie, size_t beacon_ie_len,
-                               bool authorized)
+int slsi_send_roam_vendor_event(struct slsi_dev *sdev, const u8 *bssid,
+                               const u8 *req_ie, u32 req_ie_len, const u8 *resp_ie, u32 resp_ie_len,
+                               const u8 *beacon_ie, u32 beacon_ie_len, bool authorized)
 {
-       int                                    length = ETH_ALEN + 32 + req_ie_len + resp_ie_len;
        bool                                   is_secured_bss;
        struct sk_buff                         *skb = NULL;
 
@@ -796,9 +792,11 @@ int slsi_send_roam_vendor_event(struct slsi_dev *sdev,
        SLSI_DBG2(sdev, SLSI_MLME, "authorized:%d, is_secured_bss:%d\n", authorized, is_secured_bss);
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
-       skb = cfg80211_vendor_event_alloc(sdev->wiphy, NULL, length, SLSI_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH, GFP_KERNEL);
+       skb = cfg80211_vendor_event_alloc(sdev->wiphy, NULL, NLMSG_DEFAULT_SIZE,
+                                         SLSI_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH, GFP_KERNEL);
 #else
-       skb = cfg80211_vendor_event_alloc(sdev->wiphy, length, SLSI_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH, GFP_KERNEL);
+       skb = cfg80211_vendor_event_alloc(sdev->wiphy, NLMSG_DEFAULT_SIZE,
+                                         SLSI_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH, GFP_KERNEL);
 #endif
        if (!skb) {
                SLSI_ERR_NODEV("Failed to allocate skb for VENDOR Roam event\n");
@@ -809,7 +807,8 @@ int slsi_send_roam_vendor_event(struct slsi_dev *sdev,
           (req_ie && nla_put(skb, SLSI_WLAN_VENDOR_ATTR_ROAM_AUTH_REQ_IE, req_ie_len, req_ie)) ||
           (resp_ie && nla_put(skb, SLSI_WLAN_VENDOR_ATTR_ROAM_AUTH_RESP_IE, resp_ie_len, resp_ie)) ||
           (beacon_ie && nla_put(skb, SLSI_WLAN_VENDOR_ATTR_ROAM_BEACON_IE, beacon_ie_len, beacon_ie))) {
-               SLSI_ERR_NODEV("Failed nla_put 1\n");
+               SLSI_ERR_NODEV("Failed nla_put ,req_ie_len=%d,resp_ie_len=%d,beacon_ie_len=%d\n",
+                              req_ie_len, resp_ie_len, beacon_ie_len);
                slsi_kfree_skb(skb);
                return -EINVAL;
        }