mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 00:24:20 +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
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
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)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
_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->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
|
||||
|
@ -314,7 +296,6 @@ void rtw_indicate_sta_assoc_event(_adapter *padapter, struct sta_info *psta)
|
|||
#ifndef CONFIG_IOCTL_CFG80211
|
||||
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
|
||||
#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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
#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)
|
||||
|
|
|
@ -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);
|
||||
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 */
|
||||
if (register_netdev(pnetdev) != 0) {
|
||||
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
|
||||
free_mlme_ap_info(if1);
|
||||
#ifdef CONFIG_HOSTAPD_MLME
|
||||
hostapd_mode_unload(if1);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (if1->DriverState != DRIVER_DISAPPEAR) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue