mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2024-12-25 05:21:45 +00:00
Merge pull request #248 from CGarces/cleanup
Removed unused and empty functions
This commit is contained in:
commit
762197367c
4
Makefile
4
Makefile
@ -4,12 +4,8 @@ EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
|
||||
EXTRA_CFLAGS += -O2
|
||||
##################### Compile-time Warnings #######################
|
||||
EXTRA_CFLAGS += -Wno-unused-variable
|
||||
EXTRA_CFLAGS += -Wno-unused-value
|
||||
EXTRA_CFLAGS += -Wno-unused-label
|
||||
EXTRA_CFLAGS += -Wno-unused-parameter
|
||||
EXTRA_CFLAGS += -Wno-unused-function
|
||||
#EXTRA_CFLAGS += -Wno-vla
|
||||
EXTRA_CFLAGS += -Wno-date-time
|
||||
|
||||
GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
|
||||
ifeq ($(GCC_VER_49),1)
|
||||
|
@ -42,7 +42,7 @@ const char *rtw_log_level_str[] = {
|
||||
void dump_drv_version(void *sel)
|
||||
{
|
||||
RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION);
|
||||
RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__);
|
||||
// RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__);
|
||||
}
|
||||
|
||||
void dump_drv_cfg(void *sel)
|
||||
|
@ -268,15 +268,6 @@ static void halbtcoutsrc_DbgInit(void)
|
||||
GLBtcDbgType[i] = 0;
|
||||
}
|
||||
|
||||
static u8 halbtcoutsrc_IsCsrBtCoex(PBTC_COEXIST pBtCoexist)
|
||||
{
|
||||
if (pBtCoexist->board_info.bt_chip_type == BTC_CHIP_CSR_BC4
|
||||
|| pBtCoexist->board_info.bt_chip_type == BTC_CHIP_CSR_BC8
|
||||
)
|
||||
return _TRUE;
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
static void halbtcoutsrc_EnterPwrLock(PBTC_COEXIST pBtCoexist)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj((PADAPTER)pBtCoexist->Adapter);
|
||||
@ -4872,53 +4863,6 @@ u8 EXhalbtcoutsrc_rate_id_to_btc_rate_id(u8 rate_id)
|
||||
return btc_rate_id;
|
||||
}
|
||||
|
||||
static void halbt_init_hw_config92C(PADAPTER padapter)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
u8 u1Tmp;
|
||||
|
||||
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
if ((pHalData->bt_coexist.btChipType == BT_CSR_BC4) ||
|
||||
(pHalData->bt_coexist.btChipType == BT_CSR_BC8)) {
|
||||
if (pHalData->rf_type == RF_1T1R) {
|
||||
/* Config to 1T1R */
|
||||
u1Tmp = rtw_read8(padapter, rOFDM0_TRxPathEnable);
|
||||
u1Tmp &= ~BIT(1);
|
||||
rtw_write8(padapter, rOFDM0_TRxPathEnable, u1Tmp);
|
||||
RT_DISP(FBT, BT_TRACE, ("[BTCoex], BT write 0xC04 = 0x%x\n", u1Tmp));
|
||||
|
||||
u1Tmp = rtw_read8(padapter, rOFDM1_TRxPathEnable);
|
||||
u1Tmp &= ~BIT(1);
|
||||
rtw_write8(padapter, rOFDM1_TRxPathEnable, u1Tmp);
|
||||
RT_DISP(FBT, BT_TRACE, ("[BTCoex], BT write 0xD04 = 0x%x\n", u1Tmp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void halbt_init_hw_config92D(PADAPTER padapter)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
u8 u1Tmp;
|
||||
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
if ((pHalData->bt_coexist.btChipType == BT_CSR_BC4) ||
|
||||
(pHalData->bt_coexist.btChipType == BT_CSR_BC8)) {
|
||||
if (pHalData->rf_type == RF_1T1R) {
|
||||
/* Config to 1T1R */
|
||||
u1Tmp = rtw_read8(padapter, rOFDM0_TRxPathEnable);
|
||||
u1Tmp &= ~BIT(1);
|
||||
rtw_write8(padapter, rOFDM0_TRxPathEnable, u1Tmp);
|
||||
RT_DISP(FBT, BT_TRACE, ("[BTCoex], BT write 0xC04 = 0x%x\n", u1Tmp));
|
||||
|
||||
u1Tmp = rtw_read8(padapter, rOFDM1_TRxPathEnable);
|
||||
u1Tmp &= ~BIT(1);
|
||||
rtw_write8(padapter, rOFDM1_TRxPathEnable, u1Tmp);
|
||||
RT_DISP(FBT, BT_TRACE, ("[BTCoex], BT write 0xD04 = 0x%x\n", u1Tmp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Description:
|
||||
* Run BT-Coexist mechansim or not
|
||||
|
@ -1075,48 +1075,7 @@ static VOID _ThreeOutPipeMapping(
|
||||
}
|
||||
|
||||
}
|
||||
static VOID _FourOutPipeMapping(
|
||||
IN PADAPTER pAdapter,
|
||||
IN BOOLEAN bWIFICfg
|
||||
)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
|
||||
|
||||
if (bWIFICfg) { /* for WMM */
|
||||
|
||||
/* BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA */
|
||||
/* { 1, 2, 1, 0, 0, 0, 0, 0, 0 }; */
|
||||
/* 0:H, 1:N, 2:L ,3:E */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[3];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
|
||||
} else { /* typical setting */
|
||||
|
||||
|
||||
/* BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA */
|
||||
/* { 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
|
||||
/* 0:H, 1:N, 2:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[2];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[3];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
}
|
||||
|
||||
}
|
||||
BOOLEAN
|
||||
Hal_MappingOutPipe(
|
||||
IN PADAPTER pAdapter,
|
||||
|
@ -106,15 +106,6 @@ check_positive(struct dm_struct *dm,
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean
|
||||
check_negative(struct dm_struct *dm,
|
||||
const u32 condition1,
|
||||
const u32 condition2
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* agc_tab.TXT
|
||||
******************************************************************************/
|
||||
|
@ -106,15 +106,6 @@ check_positive(struct dm_struct *dm,
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean
|
||||
check_negative(struct dm_struct *dm,
|
||||
const u32 condition1,
|
||||
const u32 condition2
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* mac_reg.TXT
|
||||
******************************************************************************/
|
||||
|
@ -106,15 +106,6 @@ check_positive(struct dm_struct *dm,
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean
|
||||
check_negative(struct dm_struct *dm,
|
||||
const u32 condition1,
|
||||
const u32 condition2
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* radioa.TXT
|
||||
******************************************************************************/
|
||||
|
@ -31,32 +31,6 @@
|
||||
* Global var
|
||||
* ************************************************************ */
|
||||
|
||||
|
||||
static VOID
|
||||
dm_CheckProtection(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo);
|
||||
u1Byte CurRate, RateThreshold;
|
||||
|
||||
if (pMgntInfo->pHTInfo->bCurBW40MHz)
|
||||
RateThreshold = MGN_MCS1;
|
||||
else
|
||||
RateThreshold = MGN_MCS3;
|
||||
|
||||
if (Adapter->TxStats.CurrentInitTxRate <= RateThreshold) {
|
||||
pMgntInfo->bDmDisableProtect = TRUE;
|
||||
DbgPrint("Forced disable protect: %x\n", Adapter->TxStats.CurrentInitTxRate);
|
||||
} else {
|
||||
pMgntInfo->bDmDisableProtect = FALSE;
|
||||
DbgPrint("Enable protect: %x\n", Adapter->TxStats.CurrentInitTxRate);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_SUPPORT_HW_WPS_PBC
|
||||
static void dm_CheckPbcGPIO(_adapter *padapter)
|
||||
{
|
||||
|
@ -290,25 +290,6 @@ _PageWrite_8192E(
|
||||
return _BlockWrite_8192E(padapter, buffer, size);
|
||||
}
|
||||
|
||||
static VOID
|
||||
_FillDummy_8192E(
|
||||
u8 *pFwBuf,
|
||||
u32 *pFwLen
|
||||
)
|
||||
{
|
||||
u32 FwLen = *pFwLen;
|
||||
u8 remain = (u8)(FwLen % 4);
|
||||
remain = (remain == 0) ? 0 : (4 - remain);
|
||||
|
||||
while (remain > 0) {
|
||||
pFwBuf[FwLen] = 0;
|
||||
FwLen++;
|
||||
remain--;
|
||||
}
|
||||
|
||||
*pFwLen = FwLen;
|
||||
}
|
||||
|
||||
static int
|
||||
_WriteFW_8192E(
|
||||
IN PADAPTER padapter,
|
||||
@ -1204,46 +1185,6 @@ rtl8192E_EfusePowerSwitch(
|
||||
Hal_EfusePowerSwitch8192E(pAdapter, bWrite, PwrState);
|
||||
}
|
||||
|
||||
|
||||
static bool efuse_read_phymap(
|
||||
PADAPTER Adapter,
|
||||
u8 *pbuf, /* buffer to store efuse physical map */
|
||||
u16 *size /* the max byte to read. will update to byte read */
|
||||
)
|
||||
{
|
||||
u8 *pos = pbuf;
|
||||
u16 limit = *size;
|
||||
u16 addr = 0;
|
||||
bool reach_end = _FALSE;
|
||||
|
||||
/* */
|
||||
/* Refresh efuse init map as all 0xFF. */
|
||||
/* */
|
||||
memset(pbuf, 0xFF, limit);
|
||||
|
||||
|
||||
/* */
|
||||
/* Read physical efuse content. */
|
||||
/* */
|
||||
while (addr < limit) {
|
||||
ReadEFuseByte(Adapter, addr, pos, _FALSE);
|
||||
if (*pos != 0xFF) {
|
||||
pos++;
|
||||
addr++;
|
||||
} else {
|
||||
reach_end = _TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*size = addr;
|
||||
|
||||
return reach_end;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
static VOID
|
||||
Hal_EfuseReadEFuse8192E(
|
||||
PADAPTER Adapter,
|
||||
|
@ -24,19 +24,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static void _dbg_dump_macreg(_adapter *padapter)
|
||||
{
|
||||
u32 offset = 0;
|
||||
u32 val32 = 0;
|
||||
u32 index = 0 ;
|
||||
for (index = 0; index < 64; index++) {
|
||||
offset = index * 4;
|
||||
val32 = rtw_read32(padapter, offset);
|
||||
RTW_INFO("offset : 0x%02x ,val:0x%08x\n", offset, val32);
|
||||
}
|
||||
}
|
||||
|
||||
static VOID
|
||||
_ConfigChipOutEP_8192E(
|
||||
IN PADAPTER pAdapter,
|
||||
@ -264,10 +251,10 @@ static u32 _InitPowerOn_8192EU(_adapter *padapter)
|
||||
rtw_write8(padapter, REG_LDO_SWR_CTRL, 0xC3);
|
||||
} else {
|
||||
/* SPS */
|
||||
/* 0x7C [6] = 1¡¦b0 (IC default, 0x83) */
|
||||
/* 0x7C [6] = 1<EFBFBD><EFBFBD>b0 (IC default, 0x83) */
|
||||
|
||||
|
||||
/* 0x14[23:20]=b¡¦0101 (raise 1.2V voltage)
|
||||
/* 0x14[23:20]=b<EFBFBD><EFBFBD>0101 (raise 1.2V voltage)
|
||||
u1Byte tmp1Byte = PlatformEFIORead1Byte(Adapter,0x16);
|
||||
PlatformEFIOWrite1Byte(Adapter,0x16,tmp1Byte |BIT4|BIT6); */
|
||||
u32 voltage = rtw_read32(padapter , REG_SYS_SWR_CTRL2_8192E);
|
||||
@ -585,80 +572,11 @@ USB_AggModeSwitch(
|
||||
#endif
|
||||
} /* USB_AggModeSwitch */
|
||||
|
||||
static VOID _RfPowerSave(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo);
|
||||
enum rf_path eRFPath;
|
||||
|
||||
#if (DISABLE_BB_RF)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (pMgntInfo->RegRfOff == TRUE) { /* User disable RF via registry. */
|
||||
MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW);
|
||||
/* Those action will be discard in MgntActSet_RF_State because off the same state */
|
||||
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++)
|
||||
phy_set_rf_reg(Adapter, eRFPath, 0x4, 0xC00, 0x0);
|
||||
} else if (pMgntInfo->RfOffReason > RF_CHANGE_BY_PS) { /* H/W or S/W RF OFF before sleep. */
|
||||
MgntActSet_RF_State(Adapter, eRfOff, pMgntInfo->RfOffReason);
|
||||
} else {
|
||||
pHalData->eRFPowerState = eRfOn;
|
||||
pMgntInfo->RfOffReason = 0;
|
||||
if (Adapter->bInSetPower || Adapter->bResetInProgress)
|
||||
PlatformUsbEnableInPipes(Adapter);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
enum {
|
||||
Antenna_Lfet = 1,
|
||||
Antenna_Right = 2,
|
||||
};
|
||||
|
||||
/*
|
||||
* 2010/08/26 MH Add for selective suspend mode check.
|
||||
* If Efuse 0x0e bit1 is not enabled, we can not support selective suspend for Minicard and
|
||||
* slim card.
|
||||
* */
|
||||
static VOID
|
||||
HalDetectSelectiveSuspendMode(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
u8 tmpvalue;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(Adapter);
|
||||
|
||||
/* If support HW radio detect, we need to enable WOL ability, otherwise, we */
|
||||
/* can not use FW to notify host the power state switch. */
|
||||
|
||||
EFUSE_ShadowRead(Adapter, 1, EEPROM_USB_OPTIONAL1, (u32 *)&tmpvalue);
|
||||
|
||||
RTW_INFO("HalDetectSelectiveSuspendMode(): SS ");
|
||||
if (tmpvalue & BIT1)
|
||||
RTW_INFO("Enable\n");
|
||||
else {
|
||||
RTW_INFO("Disable\n");
|
||||
pdvobjpriv->RegUsbSS = _FALSE;
|
||||
}
|
||||
|
||||
/* 2010/09/01 MH According to Dongle Selective Suspend INF. We can switch SS mode. */
|
||||
if (pdvobjpriv->RegUsbSS && !SUPPORT_HW_RADIO_DETECT(pHalData)) {
|
||||
/* PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); */
|
||||
|
||||
/* if (!pMgntInfo->bRegDongleSS) */
|
||||
/* { */
|
||||
pdvobjpriv->RegUsbSS = _FALSE;
|
||||
/* } */
|
||||
}
|
||||
#endif
|
||||
} /* HalDetectSelectiveSuspendMode */
|
||||
|
||||
#if 0
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: HwSuspendModeEnable92Cu()
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)) || (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18))
|
||||
#define _usbctrl_vendorreq_async_callback(urb, regs) _usbctrl_vendorreq_async_callback(urb)
|
||||
#define usb_bulkout_zero_complete(purb, regs) usb_bulkout_zero_complete(purb)
|
||||
#define usb_write_mem_complete(purb, regs) usb_write_mem_complete(purb)
|
||||
#define usb_write_port_complete(purb, regs) usb_write_port_complete(purb)
|
||||
#define usb_read_port_complete(purb, regs) usb_read_port_complete(purb)
|
||||
|
@ -4613,11 +4613,6 @@ fail:
|
||||
|
||||
}
|
||||
|
||||
static void rtw_cfg80211_monitor_if_set_multicast_list(struct net_device *ndev)
|
||||
{
|
||||
RTW_INFO("%s\n", __func__);
|
||||
}
|
||||
|
||||
static int rtw_cfg80211_monitor_if_set_mac_address(struct net_device *ndev, void *addr)
|
||||
{
|
||||
int ret = 0;
|
||||
@ -4633,7 +4628,7 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
|
||||
.ndo_stop = rtw_cfg80211_monitor_if_close,
|
||||
.ndo_start_xmit = rtw_cfg80211_monitor_if_xmit_entry,
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0))
|
||||
.ndo_set_multicast_list = rtw_cfg80211_monitor_if_set_multicast_list,
|
||||
.ndo_set_multicast_list = NULL,
|
||||
#endif
|
||||
.ndo_set_mac_address = rtw_cfg80211_monitor_if_set_mac_address,
|
||||
};
|
||||
@ -6058,21 +6053,6 @@ static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_auth(struct wiphy *wiphy, struct net_device *ndev,
|
||||
struct cfg80211_auth_request *req)
|
||||
{
|
||||
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_assoc(struct wiphy *wiphy, struct net_device *ndev,
|
||||
struct cfg80211_assoc_request *req)
|
||||
{
|
||||
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AP_MODE */
|
||||
|
||||
void rtw_cfg80211_rx_probe_request(_adapter *adapter, union recv_frame *rframe)
|
||||
|
@ -93,40 +93,6 @@ static void indicate_wx_custom_event(_adapter *padapter, char *msg)
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void request_wps_pbc_event(_adapter *padapter)
|
||||
{
|
||||
u8 *buff, *p;
|
||||
union iwreq_data wrqu;
|
||||
|
||||
|
||||
buff = rtw_malloc(IW_CUSTOM_MAX);
|
||||
if (!buff)
|
||||
return;
|
||||
|
||||
memset(buff, 0, IW_CUSTOM_MAX);
|
||||
|
||||
p = buff;
|
||||
|
||||
p += sprintf(p, "WPS_PBC_START.request=TRUE");
|
||||
|
||||
memset(&wrqu, 0, sizeof(wrqu));
|
||||
|
||||
wrqu.data.length = p - buff;
|
||||
|
||||
wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX;
|
||||
|
||||
RTW_INFO("%s\n", __FUNCTION__);
|
||||
|
||||
#ifndef CONFIG_IOCTL_CFG80211
|
||||
wireless_send_event(padapter->pnetdev, IWEVCUSTOM, &wrqu, buff);
|
||||
#endif
|
||||
|
||||
if (buff)
|
||||
rtw_mfree(buff, IW_CUSTOM_MAX);
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SUPPORT_HW_WPS_PBC
|
||||
void rtw_request_wps_pbc_event(_adapter *padapter)
|
||||
{
|
||||
|
@ -300,82 +300,6 @@ struct zero_bulkout_context {
|
||||
void *padapter;
|
||||
};
|
||||
|
||||
static void usb_bulkout_zero_complete(struct urb *purb, struct pt_regs *regs)
|
||||
{
|
||||
struct zero_bulkout_context *pcontext = (struct zero_bulkout_context *)purb->context;
|
||||
|
||||
/* RTW_INFO("+usb_bulkout_zero_complete\n"); */
|
||||
|
||||
if (pcontext) {
|
||||
if (pcontext->pbuf)
|
||||
rtw_mfree(pcontext->pbuf, sizeof(int));
|
||||
|
||||
if (pcontext->purb && (pcontext->purb == purb))
|
||||
usb_free_urb(pcontext->purb);
|
||||
|
||||
|
||||
rtw_mfree((u8 *)pcontext, sizeof(struct zero_bulkout_context));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr)
|
||||
{
|
||||
int pipe, status, len;
|
||||
u32 ret;
|
||||
unsigned char *pbuf;
|
||||
struct zero_bulkout_context *pcontext;
|
||||
PURB purb = NULL;
|
||||
_adapter *padapter = (_adapter *)pintfhdl->padapter;
|
||||
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
|
||||
struct usb_device *pusbd = pdvobj->pusbdev;
|
||||
|
||||
/* RTW_INFO("%s\n", __func__); */
|
||||
|
||||
|
||||
if (RTW_CANNOT_TX(padapter))
|
||||
return _FAIL;
|
||||
|
||||
|
||||
pcontext = (struct zero_bulkout_context *)rtw_zmalloc(sizeof(struct zero_bulkout_context));
|
||||
if (pcontext == NULL)
|
||||
return _FAIL;
|
||||
|
||||
pbuf = (unsigned char *)rtw_zmalloc(sizeof(int));
|
||||
purb = usb_alloc_urb(0, GFP_ATOMIC);
|
||||
|
||||
/* translate DMA FIFO addr to pipehandle */
|
||||
pipe = ffaddr2pipehdl(pdvobj, addr);
|
||||
|
||||
len = 0;
|
||||
pcontext->pbuf = pbuf;
|
||||
pcontext->purb = purb;
|
||||
pcontext->pirp = NULL;
|
||||
pcontext->padapter = padapter;
|
||||
|
||||
|
||||
/* translate DMA FIFO addr to pipehandle */
|
||||
/* pipe = ffaddr2pipehdl(pdvobj, addr); */
|
||||
|
||||
usb_fill_bulk_urb(purb, pusbd, pipe,
|
||||
pbuf,
|
||||
len,
|
||||
usb_bulkout_zero_complete,
|
||||
pcontext);/* context is pcontext */
|
||||
|
||||
status = usb_submit_urb(purb, GFP_ATOMIC);
|
||||
|
||||
if (!status)
|
||||
ret = _SUCCESS;
|
||||
else
|
||||
ret = _FAIL;
|
||||
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
void usb_read_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
|
||||
{
|
||||
|
||||
|
@ -389,17 +389,6 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy
|
||||
rtw_regd_apply_flags(wiphy);
|
||||
}
|
||||
|
||||
static struct country_code_to_enum_rd *_rtw_regd_find_country(u16 countrycode)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(allCountries); i++) {
|
||||
if (allCountries[i].countrycode == countrycode)
|
||||
return &allCountries[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void rtw_regd_init(struct wiphy *wiphy)
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user