Merge remote-tracking branch 'staging/staging-next'
[deliverable/linux.git] / drivers / staging / rtl8188eu / hal / hal_intf.c
1 /******************************************************************************
2 *
3 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 ******************************************************************************/
15
16 #define _HAL_INTF_C_
17 #include <osdep_service.h>
18 #include <drv_types.h>
19 #include <hal_intf.h>
20 #include <usb_hal.h>
21
22 uint rtw_hal_init(struct adapter *adapt)
23 {
24 uint status = _SUCCESS;
25
26 adapt->hw_init_completed = false;
27
28 status = rtl8188eu_hal_init(adapt);
29
30 if (status == _SUCCESS) {
31 adapt->hw_init_completed = true;
32
33 if (adapt->registrypriv.notch_filter == 1)
34 rtw_hal_notch_filter(adapt, 1);
35 } else {
36 adapt->hw_init_completed = false;
37 DBG_88E("rtw_hal_init: hal__init fail\n");
38 }
39
40 RT_TRACE(_module_hal_init_c_, _drv_err_,
41 ("-rtl871x_hal_init:status=0x%x\n", status));
42
43 return status;
44 }
45
46 uint rtw_hal_deinit(struct adapter *adapt)
47 {
48 uint status = _SUCCESS;
49
50 status = rtl8188eu_hal_deinit(adapt);
51
52 if (status == _SUCCESS)
53 adapt->hw_init_completed = false;
54 else
55 DBG_88E("\n rtw_hal_deinit: hal_init fail\n");
56
57 return status;
58 }
59
60 void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
61 {
62 struct mlme_priv *pmlmepriv = &(adapt->mlmepriv);
63
64 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
65 #ifdef CONFIG_88EU_AP_MODE
66 struct sta_info *psta = NULL;
67 struct sta_priv *pstapriv = &adapt->stapriv;
68
69 if ((mac_id-1) > 0)
70 psta = pstapriv->sta_aid[(mac_id-1) - 1];
71 if (psta)
72 add_RATid(adapt, psta, 0);/* todo: based on rssi_level*/
73 #endif
74 } else {
75 UpdateHalRAMask8188EUsb(adapt, mac_id, rssi_level);
76 }
77 }
This page took 0.048781 seconds and 5 git commands to generate.