linux/drivers/staging/rtl8188eu/include/drv_types.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2/******************************************************************************
   3 *
   4 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
   5 *
   6 ******************************************************************************/
   7/*-----------------------------------------------------------------------------
   8
   9        For type defines and data structure defines
  10
  11------------------------------------------------------------------------------*/
  12
  13#ifndef __DRV_TYPES_H__
  14#define __DRV_TYPES_H__
  15
  16#define DRV_NAME "r8188eu"
  17
  18#include <osdep_service.h>
  19#include <wlan_bssdef.h>
  20#include <rtw_ht.h>
  21#include <rtw_cmd.h>
  22#include <rtw_xmit.h>
  23#include <rtw_recv.h>
  24#include <hal_intf.h>
  25#include <hal_com.h>
  26#include <rtw_security.h>
  27#include <rtw_pwrctrl.h>
  28#include <rtw_eeprom.h>
  29#include <sta_info.h>
  30
  31struct qos_priv {
  32        /* bit mask option: u-apsd, s-apsd, ts, block ack... */
  33        unsigned int qos_option;
  34};
  35
  36#include <rtw_mlme.h>
  37#include <rtw_rf.h>
  38#include <rtw_event.h>
  39#include <rtw_led.h>
  40#include <rtw_mlme_ext.h>
  41#include <rtw_ap.h>
  42
  43#define SPEC_DEV_ID_NONE                BIT(0)
  44#define SPEC_DEV_ID_DISABLE_HT          BIT(1)
  45#define SPEC_DEV_ID_ENABLE_PS           BIT(2)
  46#define SPEC_DEV_ID_RF_CONFIG_1T1R      BIT(3)
  47#define SPEC_DEV_ID_RF_CONFIG_2T2R      BIT(4)
  48#define SPEC_DEV_ID_ASSIGN_IFNAME       BIT(5)
  49
  50struct registry_priv {
  51        struct ndis_802_11_ssid ssid;
  52        u8      channel;/* ad-hoc support requirement */
  53        u8      wireless_mode;/* A, B, G, auto */
  54        u8      preamble;/* long, short, auto */
  55        u8      vrtl_carrier_sense;/* Enable, Disable, Auto */
  56        u8      vcs_type;/* RTS/CTS, CTS-to-self */
  57        u16     rts_thresh;
  58        u16     frag_thresh;
  59        u8      power_mgnt;
  60        u8      ips_mode;
  61        u8      smart_ps;
  62        u8      mp_mode;
  63        u8      acm_method;
  64          /* UAPSD */
  65        u8      wmm_enable;
  66        u8      uapsd_enable;
  67
  68        struct wlan_bssid_ex    dev_network;
  69
  70        u8      ht_enable;
  71        u8      cbw40_enable;
  72        u8      ampdu_enable;/* for tx */
  73        u8      rx_stbc;
  74        u8      ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
  75
  76        u8      wifi_spec;/*  !turbo_mode */
  77
  78        u8      channel_plan;
  79        bool    accept_addba_req; /* true = accept AP's Add BA req */
  80
  81        u8      antdiv_cfg;
  82        u8      antdiv_type;
  83
  84        u8      usbss_enable;/* 0:disable,1:enable */
  85        u8      hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
  86
  87        u8      max_roaming_times; /*  the max number driver will try */
  88
  89        u8      fw_iol; /* enable iol without other concern */
  90
  91        u8      enable80211d;
  92
  93        u8      ifname[16];
  94        u8      if2name[16];
  95
  96        u8      notch_filter;
  97        bool    monitor_enable;
  98};
  99
 100#define MAX_CONTINUAL_URB_ERR           4
 101
 102struct dvobj_priv {
 103        struct adapter *if1;
 104        /* For 92D, DMDP have 2 interface. */
 105        u8      InterfaceNumber;
 106        u8      NumInterfaces;
 107
 108        /* In /Out Pipe information */
 109        int     RtInPipe[2];
 110        int     RtOutPipe[3];
 111        u8      Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
 112
 113/*-------- below is for USB INTERFACE --------*/
 114        u8      ishighspeed;
 115        u8      RtNumInPipes;
 116        u8      RtNumOutPipes;
 117        struct mutex  usb_vendor_req_mutex;
 118
 119        struct usb_interface *pusbintf;
 120        struct usb_device *pusbdev;
 121};
 122
 123static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
 124{
 125        /* todo: get interface type from dvobj and the return
 126         * the dev accordingly
 127         */
 128        return &dvobj->pusbintf->dev;
 129};
 130
 131struct adapter {
 132        struct dvobj_priv *dvobj;
 133        struct  mlme_priv mlmepriv;
 134        struct  mlme_ext_priv mlmeextpriv;
 135        struct  cmd_priv        cmdpriv;
 136        struct  xmit_priv       xmitpriv;
 137        struct  recv_priv       recvpriv;
 138        struct  sta_priv        stapriv;
 139        struct  security_priv   securitypriv;
 140        struct  registry_priv   registrypriv;
 141        struct  pwrctrl_priv    pwrctrlpriv;
 142        struct  eeprom_priv eeprompriv;
 143        struct  led_priv        ledpriv;
 144
 145        struct hal_data_8188e *HalData;
 146
 147        s32     bDriverStopped;
 148        s32     bSurpriseRemoved;
 149
 150        u8      hw_init_completed;
 151
 152        struct task_struct *cmdThread;
 153        struct  net_device *pnetdev;
 154        struct  net_device *pmondev;
 155
 156        int bup;
 157        struct net_device_stats stats;
 158        struct iw_statistics iwstats;
 159        struct proc_dir_entry *dir_dev;/*  for proc directory */
 160
 161        int net_closed;
 162        u8 bFWReady;
 163        u8 bReadPortCancel;
 164        u8 bWritePortCancel;
 165
 166        struct mutex hw_init_mutex;
 167};
 168
 169#define adapter_to_dvobj(adapter) (adapter->dvobj)
 170
 171static inline u8 *myid(struct eeprom_priv *peepriv)
 172{
 173        return peepriv->mac_addr;
 174}
 175
 176#endif /* __DRV_TYPES_H__ */
 177