Skip to content

Commit

Permalink
rtl8192du: Fix build error for kernel 4.0
Browse files Browse the repository at this point in the history
A warning that appears with kernel 4.1 is also fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
  • Loading branch information
lwfinger committed May 1, 2015
1 parent 9b87522 commit 7498302
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
16 changes: 13 additions & 3 deletions os_dep/ioctl_cfg80211.c
Expand Up @@ -1276,16 +1276,23 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
goto exit;
}

#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
sinfo->filled |= STATION_INFO_SIGNAL;
sinfo->filled |= STATION_INFO_TX_BITRATE;
sinfo->filled |= STATION_INFO_RX_PACKETS;
sinfo->filled |= STATION_INFO_TX_PACKETS;
#else
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
#endif
sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength);

sinfo->filled |= STATION_INFO_TX_BITRATE;
sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);

sinfo->filled |= STATION_INFO_RX_PACKETS;
sinfo->rx_packets = sta_rx_data_pkts(psta);

sinfo->filled |= STATION_INFO_TX_PACKETS;
sinfo->tx_packets = psta->sta_stats.tx_pkts;

}
Expand Down Expand Up @@ -2756,6 +2763,9 @@ static int
const char *name,
#else
char *name,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
unsigned char name_assign_type,
#endif
enum nl80211_iftype type, u32 *flags, struct vif_params *params)
{
Expand Down
8 changes: 7 additions & 1 deletion os_dep/rtw_android.c
Expand Up @@ -219,7 +219,13 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
{
int cmd_num;
for (cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
if (0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
if (!strncasecmp(cmdstr, android_wifi_cmd_str[cmd_num],
strlen(android_wifi_cmd_str[cmd_num])))
#else
if (0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num],
strlen(android_wifi_cmd_str[cmd_num])))
#endif
break;

return cmd_num;
Expand Down

0 comments on commit 7498302

Please sign in to comment.