Skip to content

Commit

Permalink
rtl8192du: Fix build on older kernels
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
  • Loading branch information
lwfinger committed Nov 30, 2014
1 parent b566c98 commit 95d5aec
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/basic_types.h
Expand Up @@ -170,4 +170,18 @@ value to host byte ordering.*/
#define N_BYTE_ALIGMENT(__value, __aligment) ((__aligment == 1) ? \
(__value) : (((__value + __aligment - 1) / __aligment) * __aligment))

#ifndef ether_addr_copy
#define ether_addr_copy(_dst, _src) memcpy(_dst, _src, ETH_ALEN)
#endif

#ifndef IEEE80211_WEP_IV_LEN
#define IEEE80211_WEP_IV_LEN 4
#define IEEE80211_WEP_ICV_LEN 4
#define IEEE80211_CCMP_HDR_LEN 8
#define IEEE80211_CCMP_MIC_LEN 8
#define IEEE80211_TKIP_ICV_LEN 4
#define IEEE80211_TKIP_IV_LEN 8
#endif


#endif /* __BASIC_TYPES_H__ */
24 changes: 24 additions & 0 deletions include/wifi.h
Expand Up @@ -723,6 +723,30 @@ struct ADDBA_request {
__le16 BA_starting_seqctrl;
} __attribute__ ((packed));

/**
* struct cfg80211_mgmt_tx_params - mgmt tx parameters
*
* This structure provides information needed to transmit a mgmt frame
*
* @chan: channel to use
* @offchan: indicates wether off channel operation is required
* @wait: duration for ROC
* @buf: buffer to transmit
* @len: buffer length
* @no_cck: don't use cck rates for this frame
* @dont_wait_for_ack: tells the low level not to wait for an ack
*/
#ifndef cfg80211_mgmt_tx_params
struct cfg80211_mgmt_tx_params {
struct ieee80211_channel *chan;
bool offchan;
unsigned int wait;
const u8 *buf;
size_t len;
bool no_cck;
bool dont_wait_for_ack;
};
#endif

/* 802.11n HT capabilities masks */
#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002
Expand Down
12 changes: 12 additions & 0 deletions os_dep/ioctl_cfg80211.c
Expand Up @@ -3550,8 +3550,18 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len,
return ret;
}

int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
struct ieee80211_channel *chan, bool offchan,
unsigned int wait, const u8 *buf, size_t len,
bool no_cck, bool dont_wait_for_ack, u64 *cookie);
static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
struct ieee80211_channel *chan, bool offchan,
unsigned int wait, const u8 *buf, size_t len,
bool no_cck, bool dont_wait_for_ack,
#else
struct cfg80211_mgmt_tx_params *params,
#endif
u64 *cookie)
{
struct rtw_adapter *padapter =
Expand All @@ -3563,9 +3573,11 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
bool ack = true;
u8 category, action;
unsigned long start = jiffies;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
size_t len = params->len;
struct ieee80211_channel *chan = params->chan;
const u8 *buf = params->buf;
#endif
struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *)buf;
u8 tx_ch = (u8) ieee80211_frequency_to_channel(chan->center_freq);

Expand Down

0 comments on commit 95d5aec

Please sign in to comment.