本文整理汇总了C++中rtl_hal函数的典型用法代码示例。如果您正苦于以下问题:C++ rtl_hal函数的具体用法?C++ rtl_hal怎么用?C++ rtl_hal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtl_hal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rtl92c_phy_mac_config
bool rtl92c_phy_mac_config(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
bool is92c = IS_92C_SERIAL(rtlhal->version);
bool rtstatus = _rtl92c_phy_config_mac_with_headerfile(hw);
if (is92c)
rtl_write_byte(rtlpriv, 0x14, 0x71);
return rtstatus;
}
示例2: rtl_ips_nic_off_wq_callback
void rtl_ips_nic_off_wq_callback(void *data)
{
struct rtl_works *rtlworks =
container_of_dwork_rtl(data, struct rtl_works, ips_nic_off_wq);
struct ieee80211_hw *hw = rtlworks->hw;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
enum rf_pwrstate rtstate;
if (mac->opmode != NL80211_IFTYPE_STATION) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
("not station return\n"));
return;
}
if (mac->link_state > MAC80211_NOLINK)
return;
if (is_hal_stop(rtlhal))
return;
if (rtlpriv->sec.being_setkey)
return;
if (ppsc->inactiveps) {
rtstate = ppsc->rfpwr_state;
/*
*Do not enter IPS in the following conditions:
*(1) RF is already OFF or Sleep
*(2) swrf_processing (indicates the IPS is still under going)
*(3) Connectted (only disconnected can trigger IPS)
*(4) IBSS (send Beacon)
*(5) AP mode (send Beacon)
*(6) monitor mode (rcv packet)
*/
if (rtstate == ERFON &&
!ppsc->swrf_processing &&
(mac->link_state == MAC80211_NOLINK) &&
!mac->act_scanning) {
RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
("IPSEnter(): Turn off RF.\n"));
ppsc->inactive_pwrstate = ERFOFF;
ppsc->in_powersavemode = true;
/*rtl_pci_reset_trx_ring(hw); */
_rtl_ps_inactive_ps(hw);
}
}
}
示例3: rtl_usb_stop
static void rtl_usb_stop(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
set_hal_stop(rtlhal);
SET_USB_STOP(rtlusb);
rtl_usb_deinit(hw);
rtlpriv->cfg->ops->hw_disable(hw);
}
示例4: netdev_close
int netdev_close(struct net_device *ndev)
{
struct rtl_priv *rtlpriv = rtl_priv(ndev);
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
if (rtlpriv->pwrctrlpriv.bInternalAutoSuspend == _TRUE) {
/*rtw_pwr_wakeup(rtlpriv); */
if (rtlpriv->pwrctrlpriv.rf_pwrstate == rf_off)
rtlpriv->pwrctrlpriv.ps_flag = _TRUE;
}
rtlpriv->net_closed = _TRUE;
/* if (!rtlpriv->hw_init_completed)
{
DBG_871X("(1)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", rtlpriv->bup, rtlpriv->hw_init_completed);
rtlpriv->bDriverStopped = _TRUE;
rtw_dev_unload(rtlpriv);
}
else*/
if (rtlpriv->pwrctrlpriv.rf_pwrstate == rf_on) {
DBG_871X("(2)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", rtlpriv->bup, rtlpriv->hw_init_completed);
/* s1. */
if (ndev) {
if (!rtw_netif_queue_stopped(ndev))
rtw_netif_stop_queue(ndev);
}
/* s2. */
LeaveAllPowerSaveMode(rtlpriv);
rtw_disassoc_cmd(rtlpriv, 500, _FALSE);
/* s2-2. indicate disconnect to os */
rtw_indicate_disconnect(rtlpriv);
/* s2-3. */
rtw_free_assoc_resources(rtlpriv, 1);
/* s2-4. */
rtw_free_network_queue(rtlpriv, _TRUE);
/* Close LED */
rtw_hal_led_control(rtlpriv, LED_CTL_POWER_OFF);
}
kfree(rtlhal->pfirmware);
rtlhal->pfirmware = NULL;
DBG_871X("-871x_drv - drv_close, bup=%d\n", rtlpriv->bup);
return 0;
}
示例5: _rtl92s_firmware_set_h2c_cmd
static bool _rtl92s_firmware_set_h2c_cmd( struct ieee80211_hw *hw, u8 h2c_cmd,
u8 *pcmd_buffer )
{
struct rtl_priv *rtlpriv = rtl_priv( hw );
struct rtl_hal *rtlhal = rtl_hal( rtl_priv( hw ) );
struct rtl_tcb_desc *cb_desc;
struct sk_buff *skb;
u32 element_id = 0;
u32 cmd_len = 0;
u32 len;
switch ( h2c_cmd ) {
case FW_H2C_SETPWRMODE:
element_id = H2C_SETPWRMODE_CMD ;
cmd_len = sizeof( struct h2c_set_pwrmode_parm );
break;
case FW_H2C_JOINBSSRPT:
element_id = H2C_JOINBSSRPT_CMD;
cmd_len = sizeof( struct h2c_joinbss_rpt_parm );
break;
case FW_H2C_WOWLAN_UPDATE_GTK:
element_id = H2C_WOWLAN_UPDATE_GTK_CMD;
cmd_len = sizeof( struct h2c_wpa_two_way_parm );
break;
case FW_H2C_WOWLAN_UPDATE_IV:
element_id = H2C_WOWLAN_UPDATE_IV_CMD;
cmd_len = sizeof( unsigned long long );
break;
case FW_H2C_WOWLAN_OFFLOAD:
element_id = H2C_WOWLAN_FW_OFFLOAD;
cmd_len = sizeof( u8 );
break;
default:
break;
}
len = _rtl92s_get_h2c_cmdlen( MAX_TRANSMIT_BUFFER_SIZE, 1, &cmd_len );
skb = dev_alloc_skb( len );
cb_desc = ( struct rtl_tcb_desc* )( skb->cb );
cb_desc->queue_index = TXCMD_QUEUE;
cb_desc->b_cmd_or_init = DESC_PACKET_TYPE_NORMAL;
cb_desc->b_last_inipkt = false;
_rtl92s_fill_h2c_cmd( skb, MAX_TRANSMIT_BUFFER_SIZE, 1, &element_id,
&cmd_len, &pcmd_buffer, &rtlhal->h2c_txcmd_seq );
_rtl92s_cmd_send_packet( hw, skb, false );
rtlpriv->cfg->ops->tx_polling( hw, TXCMD_QUEUE );
return true;
}
示例6: rtl92c_init_beacon_parameters
void rtl92c_init_beacon_parameters(struct ieee80211_hw *hw,
enum version_8192c version)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
rtl_write_word(rtlpriv, REG_TBTT_PROHIBIT, 0x6404);/* ms */
rtl_write_byte(rtlpriv, REG_DRVERLYINT, DRIVER_EARLY_INT_TIME);/*ms*/
rtl_write_byte(rtlpriv, REG_BCNDMATIM, BCN_DMA_ATIME_INT_TIME);
if (IS_NORMAL_CHIP(rtlhal->version))
rtl_write_word(rtlpriv, REG_BCNTCFG, 0x660F);
else
rtl_write_word(rtlpriv, REG_BCNTCFG, 0x66FF);
}
示例7: rtl8723_download_fw
int rtl8723_download_fw(struct ieee80211_hw *hw,
bool is_8723be, int max_count)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtlwifi_firmware_header *pfwheader;
u8 *pfwdata;
u32 fwsize;
int err;
enum version_8723e version = rtlhal->version;
int max_page;
if (!rtlhal->pfirmware)
return 1;
pfwheader = (struct rtlwifi_firmware_header *)rtlhal->pfirmware;
pfwdata = rtlhal->pfirmware;
fwsize = rtlhal->fwsize;
if (!is_8723be)
max_page = 6;
else
max_page = 8;
if (rtlpriv->cfg->ops->is_fw_header(pfwheader)) {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
"Firmware Version(%d), Signature(%#x), Size(%d)\n",
pfwheader->version, pfwheader->signature,
(int)sizeof(struct rtlwifi_firmware_header));
pfwdata = pfwdata + sizeof(struct rtlwifi_firmware_header);
fwsize = fwsize - sizeof(struct rtlwifi_firmware_header);
}
if (rtl_read_byte(rtlpriv, REG_MCUFWDL)&BIT(7)) {
if (is_8723be)
rtl8723be_firmware_selfreset(hw);
else
rtl8723ae_firmware_selfreset(hw);
rtl_write_byte(rtlpriv, REG_MCUFWDL, 0x00);
}
rtl8723_enable_fw_download(hw, true);
rtl8723_write_fw(hw, version, pfwdata, fwsize, max_page);
rtl8723_enable_fw_download(hw, false);
err = rtl8723_fw_free_to_go(hw, is_8723be, max_count);
if (err)
pr_err("Firmware is not ready to run!\n");
return 0;
}
示例8: PHY_GetTxPowerIndexByRateArray_8812A
static void PHY_GetTxPowerIndexByRateArray_8812A(struct rtl_priv *rtlpriv,
uint8_t RFPath, enum CHANNEL_WIDTH BandWidth,
uint8_t Channel, uint8_t *Rate, uint8_t *power_index,
uint8_t ArraySize)
{
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
struct _rtw_hal *pHalData = GET_HAL_DATA(rtlpriv);
uint8_t i;
for (i = 0; i < ArraySize; i++) {
power_index[i] = _rtl8821au_get_txpower_index(rtlpriv, RFPath, Rate[i], BandWidth, Channel);
if ((power_index[i] % 2 == 1) && !IS_NORMAL_CHIP(rtlhal->version))
power_index[i] -= 1;
}
}
示例9: rtl8821au_fill_h2c_cmd
void rtl8821au_fill_h2c_cmd(struct rtl_priv *rtlpriv,
u8 element_id, u32 cmd_len,
u8 *cmdbuffer)
{
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
u32 tmp_cmdbuf[2];
if (rtlhal->fw_ready == false) {
RT_ASSERT(false,
"return H2C cmd because of Fw download fail!!!\n");
return;
}
memset(tmp_cmdbuf, 0, 8);
memcpy(tmp_cmdbuf, cmdbuffer, cmd_len);
_rtl8821au_fill_h2c_cmd(rtlpriv, element_id, cmd_len, (u8 *)&tmp_cmdbuf);
}
示例10: _rtl92cu_phy_config_bb_with_headerfile
bool _rtl92cu_phy_config_bb_with_headerfile( struct ieee80211_hw *hw,
u8 configtype )
{
int i;
u32 *phy_regarray_table;
u32 *agctab_array_table;
u16 phy_reg_arraylen, agctab_arraylen;
struct rtl_priv *rtlpriv = rtl_priv( hw );
struct rtl_hal *rtlhal = rtl_hal( rtl_priv( hw ) );
struct rtl_phy *rtlphy = &( rtlpriv->phy );
if ( IS_92C_SERIAL( rtlhal->version ) ) {
agctab_arraylen = rtlphy->hwparam_tables[AGCTAB_2T].length;
agctab_array_table = rtlphy->hwparam_tables[AGCTAB_2T].pdata;
phy_reg_arraylen = rtlphy->hwparam_tables[PHY_REG_2T].length;
phy_regarray_table = rtlphy->hwparam_tables[PHY_REG_2T].pdata;
} else {
agctab_arraylen = rtlphy->hwparam_tables[AGCTAB_1T].length;
agctab_array_table = rtlphy->hwparam_tables[AGCTAB_1T].pdata;
phy_reg_arraylen = rtlphy->hwparam_tables[PHY_REG_1T].length;
phy_regarray_table = rtlphy->hwparam_tables[PHY_REG_1T].pdata;
}
if ( configtype == BASEBAND_CONFIG_PHY_REG ) {
for ( i = 0; i < phy_reg_arraylen; i = i + 2 ) {
rtl_addr_delay( phy_regarray_table[i] );
rtl_set_bbreg( hw, phy_regarray_table[i], MASKDWORD,
phy_regarray_table[i + 1] );
udelay( 1 );
RT_TRACE( rtlpriv, COMP_INIT, DBG_TRACE,
"The phy_regarray_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
phy_regarray_table[i],
phy_regarray_table[i + 1] );
}
} else if ( configtype == BASEBAND_CONFIG_AGC_TAB ) {
for ( i = 0; i < agctab_arraylen; i = i + 2 ) {
rtl_set_bbreg( hw, agctab_array_table[i], MASKDWORD,
agctab_array_table[i + 1] );
udelay( 1 );
RT_TRACE( rtlpriv, COMP_INIT, DBG_TRACE,
"The agctab_array_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
agctab_array_table[i],
agctab_array_table[i + 1] );
}
}
return true;
}
示例11: rtl_op_start
/*mutex for start & stop is must here. */
static int rtl_op_start(struct ieee80211_hw *hw)
{
int err;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
if (!is_hal_stop(rtlhal))
return 0;
if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status))
return 0;
mutex_lock(&rtlpriv->locks.conf_mutex);
err = rtlpriv->intf_ops->adapter_start(hw);
if (!err)
rtl_watch_dog_timer_callback((unsigned long)hw);
mutex_unlock(&rtlpriv->locks.conf_mutex);
return err;
}
示例12: rtl_ips_nic_off_wq_callback
void rtl_ips_nic_off_wq_callback(void *data)
{
struct rtl_works *rtlworks =
container_of_dwork_rtl(data, struct rtl_works, ips_nic_off_wq);
struct ieee80211_hw *hw = rtlworks->hw;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
enum rf_pwrstate rtstate;
if (mac->opmode != NL80211_IFTYPE_STATION) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"not station return\n");
return;
}
if (mac->link_state > MAC80211_NOLINK)
return;
if (is_hal_stop(rtlhal))
return;
if (rtlpriv->sec.being_setkey)
return;
if (ppsc->inactiveps) {
rtstate = ppsc->rfpwr_state;
if (rtstate == ERFON &&
!ppsc->swrf_processing &&
(mac->link_state == MAC80211_NOLINK) &&
!mac->act_scanning) {
RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
"IPSEnter(): Turn off RF\n");
ppsc->inactive_pwrstate = ERFOFF;
ppsc->in_powersavemode = true;
_rtl_ps_inactive_ps(hw);
}
}
}
示例13: ODM_ConfigRFWithHeaderFile
void ODM_ConfigRFWithHeaderFile(struct rtl_priv *rtlpriv,
ODM_RF_Config_Type ConfigType, enum radio_path eRFPath)
{
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
RT_TRACE(rtlpriv, ODM_COMP_INIT, ODM_DBG_LOUD,
"===>ODM_ConfigRFWithHeaderFile (%s)\n", (IS_NORMAL_CHIP(rtlhal->version)) ? "MPChip" : "TestChip");
RT_TRACE(rtlpriv, ODM_COMP_INIT, ODM_DBG_LOUD,
"pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n",
rtlhal->interface, rtlhal->board_type);
if (IS_HARDWARE_TYPE_8812AU(rtlhal))
rtl8812au_phy_config_rf_with_headerfile(rtlpriv, eRFPath);
if (IS_HARDWARE_TYPE_8821U(rtlhal)) {
rtl8821au_phy_config_rf_with_headerfile(rtlpriv, RF90_PATH_A);
}
}
示例14: rtl92c_enable_interrupt
void rtl92c_enable_interrupt(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
if (IS_HARDWARE_TYPE_8192CE(rtlhal)) {
rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] &
0xFFFFFFFF);
rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] &
0xFFFFFFFF);
} else {
rtl_write_dword(rtlpriv, REG_HIMR, rtlusb->irq_mask[0] &
0xFFFFFFFF);
rtl_write_dword(rtlpriv, REG_HIMRE, rtlusb->irq_mask[1] &
0xFFFFFFFF);
}
}
示例15: rtl_op_sta_add
static int rtl_op_sta_add(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal= rtl_hal(rtl_priv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_sta_info *sta_entry;
if (sta) {
sta_entry = (struct rtl_sta_info *) sta->drv_priv;
spin_lock_bh(&rtlpriv->locks.entry_list_lock);
list_add_tail(&sta_entry->list, &rtlpriv->entry_list);
spin_unlock_bh(&rtlpriv->locks.entry_list_lock);
if (rtlhal->current_bandtype == BAND_ON_2_4G) {
sta_entry->wireless_mode = WIRELESS_MODE_G;
if (sta->supp_rates[0] <= 0xf)
sta_entry->wireless_mode = WIRELESS_MODE_B;
if (sta->ht_cap.ht_supported == true)
sta_entry->wireless_mode = WIRELESS_MODE_N_24G;
if (vif->type == NL80211_IFTYPE_ADHOC)
sta_entry->wireless_mode = WIRELESS_MODE_G;
} else if (rtlhal->current_bandtype == BAND_ON_5G) {
sta_entry->wireless_mode = WIRELESS_MODE_A;
if (sta->ht_cap.ht_supported == true)
sta_entry->wireless_mode = WIRELESS_MODE_N_24G;
if (vif->type == NL80211_IFTYPE_ADHOC)
sta_entry->wireless_mode = WIRELESS_MODE_A;
}
/*disable cck rate for p2p*/
if (mac->p2p)
sta->supp_rates[0] &= 0xfffffff0;
memcpy(sta_entry->mac_addr, sta->addr, ETH_ALEN);
RT_TRACE(COMP_MAC80211, DBG_DMESG,
("Add sta addr is %pM\n",sta->addr));
rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
}
return 0;
}