mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-28 23:23:40 +00:00
rtl8188eu: Remove CONFIG_HOSTAPD_MLME
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
fa5d9a4230
commit
f1dfc4fb61
10 changed files with 1 additions and 398 deletions
|
@ -651,20 +651,10 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
|
||||||
case WIFI_ASSOCREQ:
|
case WIFI_ASSOCREQ:
|
||||||
case WIFI_REASSOCREQ:
|
case WIFI_REASSOCREQ:
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
|
||||||
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case WIFI_PROBEREQ:
|
case WIFI_PROBEREQ:
|
||||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
||||||
{
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
|
||||||
#else
|
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -366,15 +366,6 @@ void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_B
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
|
|
||||||
{
|
|
||||||
if (padapter->HalFunc.hostap_mgnt_xmit_entry)
|
|
||||||
return padapter->HalFunc.hostap_mgnt_xmit_entry(padapter, pkt);
|
|
||||||
return _FAIL;
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_HOSTAPD_MLME */
|
|
||||||
|
|
||||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||||
void rtw_hal_sreset_init(_adapter *padapter)
|
void rtw_hal_sreset_init(_adapter *padapter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1068,124 +1068,3 @@ s32 rtl8188eu_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||||
{
|
{
|
||||||
return pre_xmitframe(padapter, pxmitframe);
|
return pre_xmitframe(padapter, pxmitframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
|
|
||||||
static void rtl8188eu_hostap_mgnt_xmit_cb(struct urb *urb)
|
|
||||||
{
|
|
||||||
struct sk_buff *skb = (struct sk_buff *)urb->context;
|
|
||||||
|
|
||||||
|
|
||||||
dev_kfree_skb_any(skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
s32 rtl8188eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
|
|
||||||
{
|
|
||||||
u16 fc;
|
|
||||||
int rc, len, pipe;
|
|
||||||
unsigned int bmcst, tid, qsel;
|
|
||||||
struct sk_buff *skb, *pxmit_skb;
|
|
||||||
struct urb *urb;
|
|
||||||
unsigned char *pxmitbuf;
|
|
||||||
struct tx_desc *ptxdesc;
|
|
||||||
struct rtw_ieee80211_hdr *tx_hdr;
|
|
||||||
struct hostapd_priv *phostapdpriv = padapter->phostapdpriv;
|
|
||||||
struct net_device *pnetdev = padapter->pnetdev;
|
|
||||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
|
||||||
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
|
|
||||||
|
|
||||||
|
|
||||||
skb = pkt;
|
|
||||||
|
|
||||||
len = skb->len;
|
|
||||||
tx_hdr = (struct rtw_ieee80211_hdr *)(skb->data);
|
|
||||||
fc = le16_to_cpu(tx_hdr->frame_ctl);
|
|
||||||
bmcst = IS_MCAST(tx_hdr->addr1);
|
|
||||||
|
|
||||||
if ((fc & RTW_IEEE80211_FCTL_FTYPE) != RTW_IEEE80211_FTYPE_MGMT)
|
|
||||||
goto _exit;
|
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) /* www.mail-archive.com/netdev@vger.kernel.org/msg17214.html */
|
|
||||||
pxmit_skb = dev_alloc_skb(len + TXDESC_SIZE);
|
|
||||||
#else
|
|
||||||
pxmit_skb = netdev_alloc_skb(pnetdev, len + TXDESC_SIZE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!pxmit_skb)
|
|
||||||
goto _exit;
|
|
||||||
|
|
||||||
pxmitbuf = pxmit_skb->data;
|
|
||||||
|
|
||||||
urb = usb_alloc_urb(0, GFP_ATOMIC);
|
|
||||||
if (!urb) {
|
|
||||||
goto _exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ----- fill tx desc ----- */
|
|
||||||
ptxdesc = (struct tx_desc *)pxmitbuf;
|
|
||||||
_rtw_memset(ptxdesc, 0, sizeof(*ptxdesc));
|
|
||||||
|
|
||||||
/* offset 0 */
|
|
||||||
ptxdesc->txdw0 |= cpu_to_le32(len&0x0000ffff);
|
|
||||||
ptxdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE+OFFSET_SZ)<<OFFSET_SHT)&0x00ff0000);/* default = 32 bytes for TX Desc */
|
|
||||||
ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
|
|
||||||
|
|
||||||
if (bmcst)
|
|
||||||
{
|
|
||||||
ptxdesc->txdw0 |= cpu_to_le32(BIT(24));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* offset 4 */
|
|
||||||
ptxdesc->txdw1 |= cpu_to_le32(0x00);/* MAC_ID */
|
|
||||||
|
|
||||||
ptxdesc->txdw1 |= cpu_to_le32((0x12<<QSEL_SHT)&0x00001f00);
|
|
||||||
|
|
||||||
ptxdesc->txdw1 |= cpu_to_le32((0x06<< 16) & 0x000f0000);/* b mode */
|
|
||||||
|
|
||||||
/* offset 8 */
|
|
||||||
|
|
||||||
/* offset 12 */
|
|
||||||
ptxdesc->txdw3 |= cpu_to_le32((le16_to_cpu(tx_hdr->seq_ctl)<<16)&0xffff0000);
|
|
||||||
|
|
||||||
/* offset 16 */
|
|
||||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(8));/* driver uses rate */
|
|
||||||
|
|
||||||
/* offset 20 */
|
|
||||||
|
|
||||||
|
|
||||||
/* HW append seq */
|
|
||||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(7)); /* Hw set sequence number */
|
|
||||||
ptxdesc->txdw3 |= cpu_to_le32((8 <<28)); /* set bit3 to 1. Suugested by TimChen. 2009.12.29. */
|
|
||||||
|
|
||||||
|
|
||||||
rtl8188eu_cal_txdesc_chksum(ptxdesc);
|
|
||||||
/* ----- end of fill tx desc ----- */
|
|
||||||
|
|
||||||
/* */
|
|
||||||
skb_put(pxmit_skb, len + TXDESC_SIZE);
|
|
||||||
pxmitbuf = pxmitbuf + TXDESC_SIZE;
|
|
||||||
_rtw_memcpy(pxmitbuf, skb->data, len);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ----- prepare urb for submit ----- */
|
|
||||||
|
|
||||||
/* translate DMA FIFO addr to pipehandle */
|
|
||||||
pipe = usb_sndbulkpipe(pdvobj->pusbdev, pHalData->Queue2EPNum[(u8)MGT_QUEUE_INX]&0x0f);
|
|
||||||
|
|
||||||
usb_fill_bulk_urb(urb, pdvobj->pusbdev, pipe,
|
|
||||||
pxmit_skb->data, pxmit_skb->len, rtl8192cu_hostap_mgnt_xmit_cb, pxmit_skb);
|
|
||||||
|
|
||||||
urb->transfer_flags |= URB_ZERO_PACKET;
|
|
||||||
usb_anchor_urb(urb, &phostapdpriv->anchored);
|
|
||||||
rc = usb_submit_urb(urb, GFP_ATOMIC);
|
|
||||||
if (rc < 0) {
|
|
||||||
usb_unanchor_urb(urb);
|
|
||||||
kfree_skb(skb);
|
|
||||||
}
|
|
||||||
usb_free_urb(urb);
|
|
||||||
_exit:
|
|
||||||
dev_kfree_skb_any(skb);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -3715,10 +3715,6 @@ _func_enter_;
|
||||||
pHalFunc->hal_xmit = &rtl8188eu_hal_xmit;
|
pHalFunc->hal_xmit = &rtl8188eu_hal_xmit;
|
||||||
pHalFunc->mgnt_xmit = &rtl8188eu_mgnt_xmit;
|
pHalFunc->mgnt_xmit = &rtl8188eu_mgnt_xmit;
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
pHalFunc->hostap_mgnt_xmit_entry = &rtl8188eu_hostap_mgnt_xmit_entry;
|
|
||||||
#endif
|
|
||||||
pHalFunc->interface_ps_func = &rtl8188eu_ps_func;
|
pHalFunc->interface_ps_func = &rtl8188eu_ps_func;
|
||||||
|
|
||||||
rtl8188e_set_hal_ops(pHalFunc);
|
rtl8188e_set_hal_ops(pHalFunc);
|
||||||
|
|
|
@ -90,32 +90,22 @@
|
||||||
|
|
||||||
#define CONFIG_AP_MODE
|
#define CONFIG_AP_MODE
|
||||||
#ifdef CONFIG_AP_MODE
|
#ifdef CONFIG_AP_MODE
|
||||||
//#define CONFIG_INTERRUPT_BASED_TXBCN // Tx Beacon when driver BCN_OK ,BCN_ERR interrupt occurs
|
|
||||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||||
//#define CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
#define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||||
#define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CONFIG_NATIVEAP_MLME
|
#define CONFIG_NATIVEAP_MLME
|
||||||
#ifndef CONFIG_NATIVEAP_MLME
|
|
||||||
#define CONFIG_HOSTAPD_MLME
|
|
||||||
#endif
|
|
||||||
#define CONFIG_FIND_BEST_CHANNEL
|
#define CONFIG_FIND_BEST_CHANNEL
|
||||||
//#define CONFIG_NO_WIRELESS_HANDLERS
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CONFIG_P2P
|
#define CONFIG_P2P
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
//The CONFIG_WFD is for supporting the Wi-Fi display
|
|
||||||
//#define CONFIG_WFD
|
|
||||||
|
|
||||||
#ifndef CONFIG_WIFI_TEST
|
#ifndef CONFIG_WIFI_TEST
|
||||||
#define CONFIG_P2P_REMOVE_GROUP_INFO
|
#define CONFIG_P2P_REMOVE_GROUP_INFO
|
||||||
#endif
|
#endif
|
||||||
//#define CONFIG_DBG_P2P
|
|
||||||
|
|
||||||
#define CONFIG_P2P_PS
|
#define CONFIG_P2P_PS
|
||||||
//#define CONFIG_P2P_IPS
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CONFIG_SKB_COPY //for amsdu
|
#define CONFIG_SKB_COPY //for amsdu
|
||||||
|
|
|
@ -218,10 +218,6 @@ struct hal_ops {
|
||||||
u32 (*read_rfreg)(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask);
|
u32 (*read_rfreg)(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask);
|
||||||
void (*write_rfreg)(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
|
void (*write_rfreg)(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
s32 (*hostap_mgnt_xmit_entry)(_adapter *padapter, _pkt *pkt);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void (*EfusePowerSwitch)(_adapter *padapter, u8 bWrite, u8 PwrState);
|
void (*EfusePowerSwitch)(_adapter *padapter, u8 bWrite, u8 PwrState);
|
||||||
void (*ReadEFuse)(_adapter *padapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, bool bPseudoTest);
|
void (*ReadEFuse)(_adapter *padapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, bool bPseudoTest);
|
||||||
void (*EFUSEGetEfuseDefinition)(_adapter *padapter, u8 efuseType, u8 type, void *pOut, bool bPseudoTest);
|
void (*EFUSEGetEfuseDefinition)(_adapter *padapter, u8 efuseType, u8 type, void *pOut, bool bPseudoTest);
|
||||||
|
@ -435,10 +431,6 @@ u8 rtw_hal_antdiv_before_linked(_adapter *padapter);
|
||||||
void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
|
void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||||
void rtw_hal_sreset_init(_adapter *padapter);
|
void rtw_hal_sreset_init(_adapter *padapter);
|
||||||
void rtw_hal_sreset_reset(_adapter *padapter);
|
void rtw_hal_sreset_reset(_adapter *padapter);
|
||||||
|
|
|
@ -531,12 +531,6 @@ struct mlme_priv {
|
||||||
struct hostapd_priv
|
struct hostapd_priv
|
||||||
{
|
{
|
||||||
_adapter *padapter;
|
_adapter *padapter;
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
struct net_device *pmgnt_netdev;
|
|
||||||
struct usb_anchor anchored;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int hostapd_mode_init(_adapter *padapter);
|
extern int hostapd_mode_init(_adapter *padapter);
|
||||||
|
|
|
@ -262,30 +262,12 @@ void init_addba_retry_timer(_adapter *padapter, struct sta_info *psta)
|
||||||
_init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta);
|
_init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void _reauth_timer_hdl(void *FunctionContext)
|
|
||||||
{
|
|
||||||
_adapter *padapter = (_adapter *)FunctionContext;
|
|
||||||
reauth_timer_hdl(padapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _reassoc_timer_hdl(void *FunctionContext)
|
|
||||||
{
|
|
||||||
_adapter *padapter = (_adapter *)FunctionContext;
|
|
||||||
reassoc_timer_hdl(padapter);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void init_mlme_ext_timer(_adapter *padapter)
|
void init_mlme_ext_timer(_adapter *padapter)
|
||||||
{
|
{
|
||||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||||
|
|
||||||
_init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter);
|
_init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter);
|
||||||
_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
|
_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
|
||||||
//_init_timer(&pmlmeext->ADDBA_timer, padapter->pnetdev, _addba_timer_hdl, padapter);
|
|
||||||
|
|
||||||
//_init_timer(&pmlmeext->reauth_timer, padapter->pnetdev, _reauth_timer_hdl, padapter);
|
|
||||||
//_init_timer(&pmlmeext->reassoc_timer, padapter->pnetdev, _reassoc_timer_hdl, padapter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_AP_MODE
|
#ifdef CONFIG_AP_MODE
|
||||||
|
@ -314,7 +296,6 @@ void rtw_indicate_sta_assoc_event(_adapter *padapter, struct sta_info *psta)
|
||||||
#ifndef CONFIG_IOCTL_CFG80211
|
#ifndef CONFIG_IOCTL_CFG80211
|
||||||
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
|
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta)
|
void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta)
|
||||||
|
@ -341,172 +322,6 @@ void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta)
|
||||||
#ifndef CONFIG_IOCTL_CFG80211
|
#ifndef CONFIG_IOCTL_CFG80211
|
||||||
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
|
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
|
|
||||||
static int mgnt_xmit_entry(struct sk_buff *skb, struct net_device *pnetdev)
|
|
||||||
{
|
|
||||||
struct hostapd_priv *phostapdpriv = rtw_netdev_priv(pnetdev);
|
|
||||||
_adapter *padapter = (_adapter *)phostapdpriv->padapter;
|
|
||||||
|
|
||||||
//DBG_88E("%s\n", __func__);
|
|
||||||
|
|
||||||
return rtw_hal_hostap_mgnt_xmit_entry(padapter, skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int mgnt_netdev_open(struct net_device *pnetdev)
|
|
||||||
{
|
|
||||||
struct hostapd_priv *phostapdpriv = rtw_netdev_priv(pnetdev);
|
|
||||||
|
|
||||||
DBG_88E("mgnt_netdev_open: MAC Address: %pM\n", pnetdev->dev_addr);
|
|
||||||
|
|
||||||
|
|
||||||
init_usb_anchor(&phostapdpriv->anchored);
|
|
||||||
|
|
||||||
if (!rtw_netif_queue_stopped(pnetdev))
|
|
||||||
rtw_netif_start_queue(pnetdev);
|
|
||||||
else
|
|
||||||
rtw_netif_wake_queue(pnetdev);
|
|
||||||
|
|
||||||
|
|
||||||
netif_carrier_on(pnetdev);
|
|
||||||
|
|
||||||
//rtw_write16(phostapdpriv->padapter, 0x0116, 0x0100);//only excluding beacon
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static int mgnt_netdev_close(struct net_device *pnetdev)
|
|
||||||
{
|
|
||||||
struct hostapd_priv *phostapdpriv = rtw_netdev_priv(pnetdev);
|
|
||||||
|
|
||||||
DBG_88E("%s\n", __func__);
|
|
||||||
|
|
||||||
usb_kill_anchored_urbs(&phostapdpriv->anchored);
|
|
||||||
|
|
||||||
netif_carrier_off(pnetdev);
|
|
||||||
|
|
||||||
if (!rtw_netif_queue_stopped(pnetdev))
|
|
||||||
rtw_netif_stop_queue(pnetdev);
|
|
||||||
|
|
||||||
//rtw_write16(phostapdpriv->padapter, 0x0116, 0x3f3f);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
|
|
||||||
static const struct net_device_ops rtl871x_mgnt_netdev_ops = {
|
|
||||||
.ndo_open = mgnt_netdev_open,
|
|
||||||
.ndo_stop = mgnt_netdev_close,
|
|
||||||
.ndo_start_xmit = mgnt_xmit_entry,
|
|
||||||
//.ndo_set_mac_address = r871x_net_set_mac_address,
|
|
||||||
//.ndo_get_stats = r871x_net_get_stats,
|
|
||||||
//.ndo_do_ioctl = r871x_mp_ioctl,
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int hostapd_mode_init(_adapter *padapter)
|
|
||||||
{
|
|
||||||
unsigned char mac[ETH_ALEN];
|
|
||||||
struct hostapd_priv *phostapdpriv;
|
|
||||||
struct net_device *pnetdev;
|
|
||||||
|
|
||||||
pnetdev = rtw_alloc_etherdev(sizeof(struct hostapd_priv));
|
|
||||||
if (!pnetdev)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
//SET_MODULE_OWNER(pnetdev);
|
|
||||||
ether_setup(pnetdev);
|
|
||||||
|
|
||||||
//pnetdev->type = ARPHRD_IEEE80211;
|
|
||||||
|
|
||||||
phostapdpriv = rtw_netdev_priv(pnetdev);
|
|
||||||
phostapdpriv->pmgnt_netdev = pnetdev;
|
|
||||||
phostapdpriv->padapter= padapter;
|
|
||||||
padapter->phostapdpriv = phostapdpriv;
|
|
||||||
|
|
||||||
//pnetdev->init = NULL;
|
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
|
|
||||||
|
|
||||||
DBG_88E("register rtl871x_mgnt_netdev_ops to netdev_ops\n");
|
|
||||||
|
|
||||||
pnetdev->netdev_ops = &rtl871x_mgnt_netdev_ops;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
pnetdev->open = mgnt_netdev_open;
|
|
||||||
|
|
||||||
pnetdev->stop = mgnt_netdev_close;
|
|
||||||
|
|
||||||
pnetdev->hard_start_xmit = mgnt_xmit_entry;
|
|
||||||
|
|
||||||
//pnetdev->set_mac_address = r871x_net_set_mac_address;
|
|
||||||
|
|
||||||
//pnetdev->get_stats = r871x_net_get_stats;
|
|
||||||
|
|
||||||
//pnetdev->do_ioctl = r871x_mp_ioctl;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pnetdev->watchdog_timeo = HZ; /* 1 second timeout */
|
|
||||||
|
|
||||||
//pnetdev->wireless_handlers = NULL;
|
|
||||||
|
|
||||||
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
|
|
||||||
pnetdev->features |= NETIF_F_IP_CSUM;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (dev_alloc_name(pnetdev,"mgnt.wlan%d") < 0)
|
|
||||||
{
|
|
||||||
DBG_88E("hostapd_mode_init(): dev_alloc_name, fail!\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//SET_NETDEV_DEV(pnetdev, pintfpriv->udev);
|
|
||||||
|
|
||||||
|
|
||||||
mac[0]=0x00;
|
|
||||||
mac[1]=0xe0;
|
|
||||||
mac[2]=0x4c;
|
|
||||||
mac[3]=0x87;
|
|
||||||
mac[4]=0x11;
|
|
||||||
mac[5]=0x12;
|
|
||||||
|
|
||||||
_rtw_memcpy(pnetdev->dev_addr, mac, ETH_ALEN);
|
|
||||||
|
|
||||||
|
|
||||||
netif_carrier_off(pnetdev);
|
|
||||||
|
|
||||||
|
|
||||||
/* Tell the network stack we exist */
|
|
||||||
if (register_netdev(pnetdev) != 0)
|
|
||||||
{
|
|
||||||
DBG_88E("hostapd_mode_init(): register_netdev fail!\n");
|
|
||||||
|
|
||||||
if (pnetdev)
|
|
||||||
{
|
|
||||||
rtw_free_netdev(pnetdev);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void hostapd_mode_unload(_adapter *padapter)
|
|
||||||
{
|
|
||||||
struct hostapd_priv *phostapdpriv = padapter->phostapdpriv;
|
|
||||||
struct net_device *pnetdev = phostapdpriv->pmgnt_netdev;
|
|
||||||
|
|
||||||
unregister_netdev(pnetdev);
|
|
||||||
rtw_free_netdev(pnetdev);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
|
@ -164,43 +164,6 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup)
|
||||||
|
|
||||||
void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame)
|
void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
_pkt *skb;
|
|
||||||
struct hostapd_priv *phostapdpriv = padapter->phostapdpriv;
|
|
||||||
struct net_device *pmgnt_netdev = phostapdpriv->pmgnt_netdev;
|
|
||||||
|
|
||||||
RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("+rtw_hostapd_mlme_rx\n"));
|
|
||||||
|
|
||||||
skb = precv_frame->u.hdr.pkt;
|
|
||||||
|
|
||||||
if (skb == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
skb->data = precv_frame->u.hdr.rx_data;
|
|
||||||
skb->tail = precv_frame->u.hdr.rx_tail;
|
|
||||||
skb->len = precv_frame->u.hdr.len;
|
|
||||||
|
|
||||||
//pskb_copy = skb_copy(skb, GFP_ATOMIC);
|
|
||||||
// if (skb == NULL) goto _exit;
|
|
||||||
|
|
||||||
skb->dev = pmgnt_netdev;
|
|
||||||
skb->ip_summed = CHECKSUM_NONE;
|
|
||||||
skb->pkt_type = PACKET_OTHERHOST;
|
|
||||||
//skb->protocol = __constant_htons(0x0019); /*ETH_P_80211_RAW*/
|
|
||||||
skb->protocol = __constant_htons(0x0003); /*ETH_P_80211_RAW*/
|
|
||||||
|
|
||||||
//DBG_88E("(1)data=0x%x, head=0x%x, tail=0x%x, mac_header=0x%x, len=%d\n", skb->data, skb->head, skb->tail, skb->mac_header, skb->len);
|
|
||||||
|
|
||||||
//skb->mac.raw = skb->data;
|
|
||||||
skb_reset_mac_header(skb);
|
|
||||||
|
|
||||||
//skb_pull(skb, 24);
|
|
||||||
_rtw_memset(skb->cb, 0, sizeof(skb->cb));
|
|
||||||
|
|
||||||
netif_rx(skb);
|
|
||||||
|
|
||||||
precv_frame->u.hdr.pkt = NULL; // set pointer to NULL before rtw_free_recvframe() if call netif_rx()
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame)
|
int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame)
|
||||||
|
|
|
@ -1155,10 +1155,6 @@ static _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
||||||
_rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
_rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||||||
DBG_88E("MAC Address from pnetdev->dev_addr= %pM\n", pnetdev->dev_addr);
|
DBG_88E("MAC Address from pnetdev->dev_addr= %pM\n", pnetdev->dev_addr);
|
||||||
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
hostapd_mode_init(padapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//step 6. /* Tell the network stack we exist */
|
//step 6. /* Tell the network stack we exist */
|
||||||
if (register_netdev(pnetdev) != 0) {
|
if (register_netdev(pnetdev) != 0) {
|
||||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("register_netdev() failed\n"));
|
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("register_netdev() failed\n"));
|
||||||
|
@ -1210,9 +1206,6 @@ static void rtw_usb_if1_deinit(_adapter *if1)
|
||||||
|
|
||||||
#ifdef CONFIG_AP_MODE
|
#ifdef CONFIG_AP_MODE
|
||||||
free_mlme_ap_info(if1);
|
free_mlme_ap_info(if1);
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
hostapd_mode_unload(if1);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (if1->DriverState != DRIVER_DISAPPEAR) {
|
if (if1->DriverState != DRIVER_DISAPPEAR) {
|
||||||
|
|
Loading…
Reference in a new issue