mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 12:33:40 +00:00
rtl8188eu: Remove CONFIG_MAC_LOOPBACK_DRIVER - not defined
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
57d32befb3
commit
757404fd0e
2 changed files with 0 additions and 556 deletions
|
@ -250,23 +250,6 @@ typedef enum _DRIVER_STATE{
|
|||
DRIVER_REPLACE_DONGLE = 2,
|
||||
}DRIVER_STATE;
|
||||
|
||||
#ifdef CONFIG_MAC_LOOPBACK_DRIVER
|
||||
typedef struct loopbackdata
|
||||
{
|
||||
_sema sema;
|
||||
_thread_hdl_ lbkthread;
|
||||
u8 bstop;
|
||||
u32 cnt;
|
||||
u16 size;
|
||||
u16 txsize;
|
||||
u8 txbuf[0x8000];
|
||||
u16 rxsize;
|
||||
u8 rxbuf[0x8000];
|
||||
u8 msg[100];
|
||||
|
||||
}LOOPBACKDATA, *PLOOPBACKDATA;
|
||||
#endif
|
||||
|
||||
struct _ADAPTER{
|
||||
int DriverState;// for disable driver using module, use dongle to replace module.
|
||||
int pid[3];//process id from UI, 0:wps, 1:hostapd, 2:dhcpcd
|
||||
|
@ -376,14 +359,9 @@ struct _ADAPTER{
|
|||
unsigned char br_ip[4];
|
||||
struct br_ext_info ethBrExtInfo;
|
||||
|
||||
#ifdef CONFIG_MAC_LOOPBACK_DRIVER
|
||||
PLOOPBACKDATA ploopback;
|
||||
#endif
|
||||
|
||||
u8 fix_rate;
|
||||
|
||||
unsigned char in_cta_test;
|
||||
|
||||
};
|
||||
|
||||
#define adapter_to_dvobj(adapter) (adapter->dvobj)
|
||||
|
|
|
@ -9399,506 +9399,6 @@ static int rtw_tdls_get(struct net_device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MAC_LOOPBACK_DRIVER
|
||||
|
||||
extern void rtl8188e_cal_txdesc_chksum(struct tx_desc *ptxdesc);
|
||||
#define cal_txdesc_chksum rtl8188e_cal_txdesc_chksum
|
||||
|
||||
static s32 initLoopback(PADAPTER padapter)
|
||||
{
|
||||
PLOOPBACKDATA ploopback;
|
||||
|
||||
|
||||
if (padapter->ploopback == NULL) {
|
||||
ploopback = (PLOOPBACKDATA)rtw_zmalloc(sizeof(LOOPBACKDATA));
|
||||
if (ploopback == NULL) return -ENOMEM;
|
||||
|
||||
_rtw_init_sema(&ploopback->sema, 0);
|
||||
ploopback->bstop = true;
|
||||
ploopback->cnt = 0;
|
||||
ploopback->size = 300;
|
||||
_rtw_memset(ploopback->msg, 0, sizeof(ploopback->msg));
|
||||
|
||||
padapter->ploopback = ploopback;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void freeLoopback(PADAPTER padapter)
|
||||
{
|
||||
PLOOPBACKDATA ploopback;
|
||||
|
||||
|
||||
ploopback = padapter->ploopback;
|
||||
if (ploopback) {
|
||||
rtw_mfree((u8*)ploopback, sizeof(LOOPBACKDATA));
|
||||
padapter->ploopback = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static s32 initpseudoadhoc(PADAPTER padapter)
|
||||
{
|
||||
NDIS_802_11_NETWORK_INFRASTRUCTURE networkType;
|
||||
s32 err;
|
||||
|
||||
networkType = Ndis802_11IBSS;
|
||||
err = rtw_set_802_11_infrastructure_mode(padapter, networkType);
|
||||
if (err == false) return _FAIL;
|
||||
|
||||
err = rtw_setopmode_cmd(padapter, networkType);
|
||||
if (err == _FAIL) return _FAIL;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static s32 createpseudoadhoc(PADAPTER padapter)
|
||||
{
|
||||
NDIS_802_11_AUTHENTICATION_MODE authmode;
|
||||
struct mlme_priv *pmlmepriv;
|
||||
NDIS_802_11_SSID *passoc_ssid;
|
||||
WLAN_BSSID_EX *pdev_network;
|
||||
u8 *pibss;
|
||||
u8 ssid[] = "pseduo_ad-hoc";
|
||||
s32 err;
|
||||
_irqL irqL;
|
||||
|
||||
|
||||
pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
authmode = Ndis802_11AuthModeOpen;
|
||||
err = rtw_set_802_11_authentication_mode(padapter, authmode);
|
||||
if (err == false) return _FAIL;
|
||||
|
||||
passoc_ssid = &pmlmepriv->assoc_ssid;
|
||||
_rtw_memset(passoc_ssid, 0, sizeof(NDIS_802_11_SSID));
|
||||
passoc_ssid->SsidLength = sizeof(ssid) - 1;
|
||||
_rtw_memcpy(passoc_ssid->Ssid, ssid, passoc_ssid->SsidLength);
|
||||
|
||||
pdev_network = &padapter->registrypriv.dev_network;
|
||||
pibss = padapter->registrypriv.dev_network.MacAddress;
|
||||
_rtw_memcpy(&pdev_network->Ssid, passoc_ssid, sizeof(NDIS_802_11_SSID));
|
||||
|
||||
rtw_update_registrypriv_dev_network(padapter);
|
||||
rtw_generate_random_ibss(pibss);
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
{
|
||||
struct wlan_network *pcur_network;
|
||||
struct sta_info *psta;
|
||||
|
||||
//3 create a new psta
|
||||
pcur_network = &pmlmepriv->cur_network;
|
||||
|
||||
//clear psta in the cur_network, if any
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, pcur_network->network.MacAddress);
|
||||
if (psta) rtw_free_stainfo(padapter, psta);
|
||||
|
||||
psta = rtw_alloc_stainfo(&padapter->stapriv, pibss);
|
||||
if (psta == NULL) return _FAIL;
|
||||
|
||||
//3 join psudo AdHoc
|
||||
pcur_network->join_res = 1;
|
||||
pcur_network->aid = psta->aid = 1;
|
||||
_rtw_memcpy(&pcur_network->network, pdev_network, get_WLAN_BSSID_EX_sz(pdev_network));
|
||||
|
||||
// set msr to WIFI_FW_ADHOC_STATE
|
||||
{
|
||||
u8 val8;
|
||||
|
||||
val8 = rtw_read8(padapter, MSR);
|
||||
val8 &= 0xFC; // clear NETYPE0
|
||||
val8 |= WIFI_FW_ADHOC_STATE & 0x3;
|
||||
rtw_write8(padapter, MSR, val8);
|
||||
}
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static struct xmit_frame* createloopbackpkt(PADAPTER padapter, u32 size)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv;
|
||||
struct xmit_frame *pframe;
|
||||
struct xmit_buf *pxmitbuf;
|
||||
struct pkt_attrib *pattrib;
|
||||
struct tx_desc *desc;
|
||||
u8 *pkt_start, *pkt_end, *ptr;
|
||||
struct rtw_ieee80211_hdr *hdr;
|
||||
s32 bmcast;
|
||||
_irqL irqL;
|
||||
|
||||
|
||||
if ((TXDESC_SIZE + WLANHDR_OFFSET + size) > MAX_XMITBUF_SZ) return NULL;
|
||||
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
pframe = NULL;
|
||||
|
||||
//2 1. allocate xmit frame
|
||||
pframe = rtw_alloc_xmitframe(pxmitpriv);
|
||||
if (pframe == NULL) return NULL;
|
||||
pframe->padapter = padapter;
|
||||
|
||||
//2 2. allocate xmit buffer
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
if (pxmitbuf == NULL) {
|
||||
rtw_free_xmitframe(pxmitpriv, pframe);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pframe->pxmitbuf = pxmitbuf;
|
||||
pframe->buf_addr = pxmitbuf->pbuf;
|
||||
pxmitbuf->priv_data = pframe;
|
||||
|
||||
//2 3. update_attrib()
|
||||
pattrib = &pframe->attrib;
|
||||
|
||||
// init xmitframe attribute
|
||||
_rtw_memset(pattrib, 0, sizeof(struct pkt_attrib));
|
||||
|
||||
pattrib->ether_type = 0x8723;
|
||||
_rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
|
||||
_rtw_memset(pattrib->dst, 0xFF, ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
|
||||
// pattrib->pctrl = 0;
|
||||
// pattrib->dhcp_pkt = 0;
|
||||
// pattrib->pktlen = 0;
|
||||
pattrib->ack_policy = 0;
|
||||
// pattrib->pkt_hdrlen = ETH_HLEN;
|
||||
pattrib->hdrlen = WLAN_HDR_A3_LEN;
|
||||
pattrib->subtype = WIFI_DATA;
|
||||
pattrib->priority = 0;
|
||||
pattrib->qsel = pattrib->priority;
|
||||
// do_queue_select(padapter, pattrib);
|
||||
pattrib->nr_frags = 1;
|
||||
pattrib->encrypt = 0;
|
||||
pattrib->bswenc = false;
|
||||
pattrib->qos_en = false;
|
||||
|
||||
bmcast = IS_MCAST(pattrib->ra);
|
||||
if (bmcast) {
|
||||
pattrib->mac_id = 1;
|
||||
pattrib->psta = rtw_get_bcmc_stainfo(padapter);
|
||||
} else {
|
||||
pattrib->mac_id = 0;
|
||||
pattrib->psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv));
|
||||
}
|
||||
|
||||
pattrib->pktlen = size;
|
||||
pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->pktlen;
|
||||
|
||||
//2 4. fill TX descriptor
|
||||
desc = (struct tx_desc*)pframe->buf_addr;
|
||||
_rtw_memset(desc, 0, TXDESC_SIZE);
|
||||
|
||||
fill_default_txdesc(pframe, (u8*)desc);
|
||||
|
||||
// Hw set sequence number
|
||||
((PTXDESC)desc)->hwseq_en = 0; // HWSEQ_EN, 0:disable, 1:enable
|
||||
// ((PTXDESC)desc)->hwseq_sel = 0; // HWSEQ_SEL
|
||||
|
||||
((PTXDESC)desc)->disdatafb = 1;
|
||||
|
||||
// convert to little endian
|
||||
desc->txdw0 = cpu_to_le32(desc->txdw0);
|
||||
desc->txdw1 = cpu_to_le32(desc->txdw1);
|
||||
desc->txdw2 = cpu_to_le32(desc->txdw2);
|
||||
desc->txdw3 = cpu_to_le32(desc->txdw3);
|
||||
desc->txdw4 = cpu_to_le32(desc->txdw4);
|
||||
desc->txdw5 = cpu_to_le32(desc->txdw5);
|
||||
desc->txdw6 = cpu_to_le32(desc->txdw6);
|
||||
desc->txdw7 = cpu_to_le32(desc->txdw7);
|
||||
cal_txdesc_chksum(desc);
|
||||
|
||||
//2 5. coalesce
|
||||
pkt_start = pframe->buf_addr + TXDESC_SIZE;
|
||||
pkt_end = pkt_start + pattrib->last_txcmdsz;
|
||||
|
||||
//3 5.1. make wlan header, make_wlanhdr()
|
||||
hdr = (struct rtw_ieee80211_hdr *)pkt_start;
|
||||
SetFrameSubType(&hdr->frame_ctl, pattrib->subtype);
|
||||
_rtw_memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); // DA
|
||||
_rtw_memcpy(hdr->addr2, pattrib->src, ETH_ALEN); // SA
|
||||
_rtw_memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); // RA, BSSID
|
||||
|
||||
//3 5.2. make payload
|
||||
ptr = pkt_start + pattrib->hdrlen;
|
||||
get_random_bytes(ptr, pkt_end - ptr);
|
||||
|
||||
pxmitbuf->len = TXDESC_SIZE + pattrib->last_txcmdsz;
|
||||
pxmitbuf->ptail += pxmitbuf->len;
|
||||
|
||||
return pframe;
|
||||
}
|
||||
|
||||
static void freeloopbackpkt(PADAPTER padapter, struct xmit_frame *pframe)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv;
|
||||
struct xmit_buf *pxmitbuf;
|
||||
|
||||
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
pxmitbuf = pframe->pxmitbuf;
|
||||
|
||||
rtw_free_xmitframe(pxmitpriv, pframe);
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
}
|
||||
|
||||
static void printdata(u8 *pbuf, u32 len)
|
||||
{
|
||||
u32 i, val;
|
||||
|
||||
|
||||
for (i = 0; (i+4) <= len; i+=4) {
|
||||
printk("%08X", *(u32*)(pbuf + i));
|
||||
if ((i+4) & 0x1F) printk(" ");
|
||||
else printk("\n");
|
||||
}
|
||||
|
||||
if (i < len)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
for (; i < len, i++)
|
||||
printk("%02X", pbuf+i);
|
||||
#else // __LITTLE_ENDIAN
|
||||
u8 str[9];
|
||||
u8 n;
|
||||
val = 0;
|
||||
n = len - i;
|
||||
_rtw_memcpy(&val, pbuf+i, n);
|
||||
sprintf(str, "%08X", val);
|
||||
n = (4 - n) * 2;
|
||||
printk("%8s", str+n);
|
||||
#endif // __LITTLE_ENDIAN
|
||||
}
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
static u8 pktcmp(PADAPTER padapter, u8 *txbuf, u32 txsz, u8 *rxbuf, u32 rxsz)
|
||||
{
|
||||
PHAL_DATA_TYPE phal;
|
||||
struct recv_stat *prxstat;
|
||||
struct recv_stat report;
|
||||
PRXREPORT prxreport;
|
||||
u32 drvinfosize;
|
||||
u32 rxpktsize;
|
||||
u8 fcssize;
|
||||
u8 ret = false;
|
||||
|
||||
prxstat = (struct recv_stat*)rxbuf;
|
||||
report.rxdw0 = le32_to_cpu(prxstat->rxdw0);
|
||||
report.rxdw1 = le32_to_cpu(prxstat->rxdw1);
|
||||
report.rxdw2 = le32_to_cpu(prxstat->rxdw2);
|
||||
report.rxdw3 = le32_to_cpu(prxstat->rxdw3);
|
||||
report.rxdw4 = le32_to_cpu(prxstat->rxdw4);
|
||||
report.rxdw5 = le32_to_cpu(prxstat->rxdw5);
|
||||
|
||||
prxreport = (PRXREPORT)&report;
|
||||
drvinfosize = prxreport->drvinfosize << 3;
|
||||
rxpktsize = prxreport->pktlen;
|
||||
|
||||
phal = GET_HAL_DATA(padapter);
|
||||
if (phal->ReceiveConfig & RCR_APPFCS) fcssize = IEEE80211_FCS_LEN;
|
||||
else fcssize = 0;
|
||||
|
||||
if ((txsz - TXDESC_SIZE) != (rxpktsize - fcssize)) {
|
||||
DBG_88E("%s: ERROR! size not match tx/rx=%d/%d !\n",
|
||||
__func__, txsz - TXDESC_SIZE, rxpktsize - fcssize);
|
||||
ret = false;
|
||||
} else {
|
||||
ret = !memcmp(txbuf + TXDESC_SIZE,
|
||||
rxbuf + RXDESC_SIZE + drvinfosize,
|
||||
txsz - TXDESC_SIZE);
|
||||
if (ret == false) {
|
||||
DBG_88E("%s: ERROR! pkt content mismatch!\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == false)
|
||||
{
|
||||
DBG_88E("\n%s: TX PKT total=%d, desc=%d, content=%d\n",
|
||||
__func__, txsz, TXDESC_SIZE, txsz - TXDESC_SIZE);
|
||||
DBG_88E("%s: TX DESC size=%d\n", __func__, TXDESC_SIZE);
|
||||
printdata(txbuf, TXDESC_SIZE);
|
||||
DBG_88E("%s: TX content size=%d\n", __func__, txsz - TXDESC_SIZE);
|
||||
printdata(txbuf + TXDESC_SIZE, txsz - TXDESC_SIZE);
|
||||
|
||||
DBG_88E("\n%s: RX PKT read=%d offset=%d(%d,%d) content=%d\n",
|
||||
__func__, rxsz, RXDESC_SIZE + drvinfosize, RXDESC_SIZE, drvinfosize, rxpktsize);
|
||||
if (rxpktsize != 0)
|
||||
{
|
||||
DBG_88E("%s: RX DESC size=%d\n", __func__, RXDESC_SIZE);
|
||||
printdata(rxbuf, RXDESC_SIZE);
|
||||
DBG_88E("%s: RX drvinfo size=%d\n", __func__, drvinfosize);
|
||||
printdata(rxbuf + RXDESC_SIZE, drvinfosize);
|
||||
DBG_88E("%s: RX content size=%d\n", __func__, rxpktsize);
|
||||
printdata(rxbuf + RXDESC_SIZE + drvinfosize, rxpktsize);
|
||||
} else {
|
||||
DBG_88E("%s: RX data size=%d\n", __func__, rxsz);
|
||||
printdata(rxbuf, rxsz);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
thread_return lbk_thread(thread_context context)
|
||||
{
|
||||
s32 err;
|
||||
PADAPTER padapter;
|
||||
PLOOPBACKDATA ploopback;
|
||||
struct xmit_frame *pxmitframe;
|
||||
u32 cnt, ok, fail, headerlen;
|
||||
u32 pktsize;
|
||||
u32 ff_hwaddr;
|
||||
|
||||
|
||||
padapter = (PADAPTER)context;
|
||||
ploopback = padapter->ploopback;
|
||||
if (ploopback == NULL) return -1;
|
||||
cnt = 0;
|
||||
ok = 0;
|
||||
fail = 0;
|
||||
|
||||
daemonize("%s", "RTW_LBK_THREAD");
|
||||
allow_signal(SIGTERM);
|
||||
|
||||
do {
|
||||
if (ploopback->size == 0) {
|
||||
get_random_bytes(&pktsize, 4);
|
||||
pktsize = (pktsize % 1535) + 1; // 1~1535
|
||||
} else
|
||||
pktsize = ploopback->size;
|
||||
|
||||
pxmitframe = createloopbackpkt(padapter, pktsize);
|
||||
if (pxmitframe == NULL) {
|
||||
sprintf(ploopback->msg, "loopback FAIL! 3. create Packet FAIL!");
|
||||
break;
|
||||
}
|
||||
|
||||
ploopback->txsize = TXDESC_SIZE + pxmitframe->attrib.last_txcmdsz;
|
||||
_rtw_memcpy(ploopback->txbuf, pxmitframe->buf_addr, ploopback->txsize);
|
||||
ff_hwaddr = rtw_get_ff_hwaddr(pxmitframe);
|
||||
cnt++;
|
||||
DBG_88E("%s: wirte port cnt=%d size=%d\n", __func__, cnt, ploopback->txsize);
|
||||
pxmitframe->pxmitbuf->pdata = ploopback->txbuf;
|
||||
rtw_write_port(padapter, ff_hwaddr, ploopback->txsize, (u8 *)pxmitframe->pxmitbuf);
|
||||
|
||||
// wait for rx pkt
|
||||
_rtw_down_sema(&ploopback->sema);
|
||||
|
||||
err = pktcmp(padapter, ploopback->txbuf, ploopback->txsize, ploopback->rxbuf, ploopback->rxsize);
|
||||
if (err == true)
|
||||
ok++;
|
||||
else
|
||||
fail++;
|
||||
|
||||
ploopback->txsize = 0;
|
||||
_rtw_memset(ploopback->txbuf, 0, 0x8000);
|
||||
ploopback->rxsize = 0;
|
||||
_rtw_memset(ploopback->rxbuf, 0, 0x8000);
|
||||
|
||||
freeloopbackpkt(padapter, pxmitframe);
|
||||
pxmitframe = NULL;
|
||||
|
||||
if (signal_pending(current)) {
|
||||
flush_signals(current);
|
||||
}
|
||||
|
||||
if ((ploopback->bstop == true) ||
|
||||
((ploopback->cnt != 0) && (ploopback->cnt == cnt)))
|
||||
{
|
||||
u32 ok_rate, fail_rate, all;
|
||||
all = cnt;
|
||||
ok_rate = (ok*100)/all;
|
||||
fail_rate = (fail*100)/all;
|
||||
sprintf(ploopback->msg,\
|
||||
"loopback result: ok=%d%%(%d/%d),error=%d%%(%d/%d)",\
|
||||
ok_rate, ok, all, fail_rate, fail, all);
|
||||
break;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
ploopback->bstop = true;
|
||||
|
||||
thread_exit();
|
||||
}
|
||||
|
||||
static void loopbackTest(PADAPTER padapter, u32 cnt, u32 size, u8* pmsg)
|
||||
{
|
||||
PLOOPBACKDATA ploopback;
|
||||
u32 len;
|
||||
s32 err;
|
||||
|
||||
|
||||
ploopback = padapter->ploopback;
|
||||
|
||||
if (ploopback)
|
||||
{
|
||||
if (ploopback->bstop == false) {
|
||||
ploopback->bstop = true;
|
||||
_rtw_up_sema(&ploopback->sema);
|
||||
}
|
||||
len = 0;
|
||||
do {
|
||||
len = strlen(ploopback->msg);
|
||||
if (len) break;
|
||||
rtw_msleep_os(1);
|
||||
} while (1);
|
||||
_rtw_memcpy(pmsg, ploopback->msg, len+1);
|
||||
freeLoopback(padapter);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// disable dynamic algorithm
|
||||
{
|
||||
u32 DMFlag = DYNAMIC_FUNC_DISABLE;
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_DM_FLAG, (u8*)&DMFlag);
|
||||
}
|
||||
|
||||
// create pseudo ad-hoc connection
|
||||
err = initpseudoadhoc(padapter);
|
||||
if (err == _FAIL) {
|
||||
sprintf(pmsg, "loopback FAIL! 1.1 init ad-hoc FAIL!");
|
||||
return;
|
||||
}
|
||||
|
||||
err = createpseudoadhoc(padapter);
|
||||
if (err == _FAIL) {
|
||||
sprintf(pmsg, "loopback FAIL! 1.2 create ad-hoc master FAIL!");
|
||||
return;
|
||||
}
|
||||
|
||||
err = initLoopback(padapter);
|
||||
if (err) {
|
||||
sprintf(pmsg, "loopback FAIL! 2. init FAIL! error code=%d", err);
|
||||
return;
|
||||
}
|
||||
|
||||
ploopback = padapter->ploopback;
|
||||
|
||||
ploopback->bstop = false;
|
||||
ploopback->cnt = cnt;
|
||||
ploopback->size = size;
|
||||
ploopback->lbkthread = kthread_run(lbk_thread, padapter, "RTW_LBK_THREAD");
|
||||
if (IS_ERR(padapter->lbkthread))
|
||||
{
|
||||
freeLoopback(padapter);
|
||||
sprintf(pmsg, "loopback start FAIL! cnt=%d", cnt);
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf(pmsg, "loopback start! cnt=%d", cnt);
|
||||
}
|
||||
#endif // CONFIG_MAC_LOOPBACK_DRIVER
|
||||
|
||||
static int rtw_test(
|
||||
struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
|
@ -9935,40 +9435,6 @@ static int rtw_test(
|
|||
return -EFAULT;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MAC_LOOPBACK_DRIVER
|
||||
if (strcmp(pch, "loopback") == 0)
|
||||
{
|
||||
s32 cnt = 0;
|
||||
u32 size = 64;
|
||||
|
||||
pch = strsep(&ptmp, delim);
|
||||
if ((pch == NULL) || (strlen(pch) == 0)) {
|
||||
rtw_mfree(pbuf, len);
|
||||
DBG_88E("%s: parameter error(level 2)!\n", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
sscanf(pch, "%d", &cnt);
|
||||
DBG_88E("%s: loopback cnt=%d\n", __func__, cnt);
|
||||
|
||||
pch = strsep(&ptmp, delim);
|
||||
if ((pch == NULL) || (strlen(pch) == 0)) {
|
||||
rtw_mfree(pbuf, len);
|
||||
DBG_88E("%s: parameter error(level 2)!\n", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
sscanf(pch, "%d", &size);
|
||||
DBG_88E("%s: loopback size=%d\n", __func__, size);
|
||||
|
||||
loopbackTest(padapter, cnt, size, extra);
|
||||
wrqu->data.length = strlen(extra) + 1;
|
||||
|
||||
rtw_mfree(pbuf, len);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_mfree(pbuf, len);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue