📄 aironet4500.h
字号:
// this might be wrong and reading is not implemented(was not in spec properly)#define awc_Set_PLCP_Word(PLCP_Word)\ awc_command_Set_Phy_register(base,0x8000,0 ,PLCP_Word)#define awc_Set_TX_Test_Freq(Tx_Test_Freq)\ awc_command_Set_Phy_register(base,0x8002,0 ,Tx_Test_Freq)#define awc_Set_Tx_Power(Tx_Power)\ awc_command_Set_Phy_register(base,0x8004,0 ,Tx_Power)#define awc_Set_RSSI_Treshold(RSSI_Treshold)\ awc_command_Set_Phy_register(base,0x8006,0 ,RSSI_Treshold)#define awc_Get_PLCP_Word(PLCP_Word)\ awc_command_Set_Phy_register(base,0x8000,0 ,0)#define awc_Get_TX_Test_Freq(Tx_Test_Freq)\ awc_command_Set_Phy_register(base,0x8002,0 ,0)#define awc_Get_Tx_Power(Tx_Power)\ awc_command_Set_Phy_register(base,0x8004,0 ,0)#define awc_Get_RSSI_Treshold(RSSI_Treshold)\ awc_command_Set_Phy_register(base,0x8006,0 ,0)#define awc_tx_test_code_end 0x0000 // Ends the transmitter test#define awc_tx_test_code_loop 0x0001 // Loop back to the beginning of the commands#define awc_tx_test_code_start 0x0002 // Start transmitting#define awc_tx_test_code_stop 0x0003 // Stop transmitting#define awc_tx_test_code_delayu 0x0004 // Delay for N usec where N is the next word#define awc_tx_test_code_delayk 0x0005 // Delay for N Kusec where N is the next word#define awc_tx_test_code_next 0x0006 // Go to the next frequency in the frequency RID#define awc_tx_test_code_rx 0x0007 // Start receive mode#define awc_tx_test_code_strings {\{ awc_tx_test_code_end , 0x000f ," Ends the transmitter test"},\{ awc_tx_test_code_loop , 0x000f ," Loop back to the beginning of the commands"},\{ awc_tx_test_code_start , 0x000f ," Start transmitting"},\{ awc_tx_test_code_stop , 0x000f ," Stop transmitting"},\{ awc_tx_test_code_delayu , 0x000f ," Delay for N usec where N is the next word"},\{ awc_tx_test_code_delayk , 0x000f ," Delay for N Kusec where N is the next word"},\{ awc_tx_test_code_next , 0x000f ," Go to the next frequency in the frequency RID"},\{ awc_tx_test_code_rx , 0x000f ," Start receive mode"},\{ 0 , 0x000f ,NULL}\};#define AWC_COMMSTAT_HARD_RESET 0x0000001#define AWC_COMMSTAT_WAKE 0x0000002#define AWC_COMMSTAT_SOFT_RESET 0x0000004#define AWC_COMMSTAT_CONFIGURE 0x0000008#define AWC_COMMSTAT_READ_CONF 0x0000010#define AWC_COMMSTAT_SAVE_CONF 0x0000020#define AWC_COMMSTAT_DEALLOC 0x0000040#define AWC_COMMSTAT_ALLOC_TX 0x0000080#define AWC_COMMSTAT_ALLOC_TEST 0x0000100#define AWC_COMMSTAT_ENABLE_MAC 0x0000200#define AWC_COMMSTAT_ENABLE_RX 0x0000400#define AWC_COMMSTAT_DISABLE_MAC 0x0000800#define AWC_COMMSTAT_RX_ACK 0x0001000#define AWC_COMMSTAT_TX_ACK 0x0002000#define AWC_COMMSTAT_AWAKEN_ACK 0x0004000#define AWC_COMMSTAT_TX_FAIL_ACK 0x0008000#define AWC_COMMSTAT_LINK_ACK 0x0010000#define AWC_COMMSTAT_CLR_CMD 0x0020000#define AWC_COMMSTAT_ALLOC_ACK 0x0040000#define AWC_COMMSTAT_HOST_SLEEP 0x0080000#define AWC_COMMSTAT_RX 0x0100000#define AWC_COMMSTAT_TX 0x0200000#define AWC_COMMSTAT_SLEEP 0x0400000#define AWC_COMMSTAT_PSP_NODES 0x0800000#define AWC_COMMSTAT_SET_TX_POWER 0x1000000/***************************** R I D ***************/#define AWC_NOF_RIDS 18extern int awc_rid_setup(struct net_device * dev);struct aironet4500_rid_selector{ const u16 selector; const unsigned MAC_Disable_at_write:1; const unsigned read_only:1; const unsigned may_change:1; const char * name;};extern const struct aironet4500_rid_selector aironet4500_RID_Select_General_Config;extern const struct aironet4500_rid_selector aironet4500_RID_Select_SSID_list;extern const struct aironet4500_rid_selector aironet4500_RID_Select_AP_list ;extern const struct aironet4500_rid_selector aironet4500_RID_Select_Driver_name;extern const struct aironet4500_rid_selector aironet4500_RID_Select_Encapsulation;extern const struct aironet4500_rid_selector aironet4500_RID_Select_Active_Config;extern const struct aironet4500_rid_selector aironet4500_RID_Select_Capabilities;extern const struct aironet4500_rid_selector aironet4500_RID_Select_AP_Info ;extern const struct aironet4500_rid_selector aironet4500_RID_Select_Radio_Info;extern const struct aironet4500_rid_selector aironet4500_RID_Select_Status ;extern const struct aironet4500_rid_selector aironet4500_RID_Select_Modulation ;extern const struct aironet4500_rid_selector aironet4500_RID_Select_WEP_volatile ;extern const struct aironet4500_rid_selector aironet4500_RID_Select_WEP_nonvolatile ;extern const struct aironet4500_rid_selector aironet4500_RID_Select_16_stats;extern const struct aironet4500_rid_selector aironet4500_RID_Select_16_stats_delta;extern const struct aironet4500_rid_selector aironet4500_RID_Select_16_stats_clear;extern const struct aironet4500_rid_selector aironet4500_RID_Select_32_stats;extern const struct aironet4500_rid_selector aironet4500_RID_Select_32_stats_delta;extern const struct aironet4500_rid_selector aironet4500_RID_Select_32_stats_clear;#define awc_def_gen_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_General_Config,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_SSID_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_SSID_list,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_AP_List_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_AP_list,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_Dname_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_Driver_name,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_act_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_Active_Config,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_Cap_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_Capabilities,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_AP_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_AP_Info,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_Radio_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_Radio_Info,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_Stat_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_Status,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_Enc_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_Encapsulation,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_WEPv_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_WEP_volatile,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_WEPnv_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_WEP_nonvolatile,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_Modulation_RID(offset,name, bits,mask,value,value_name)\ {&aironet4500_RID_Select_Modulation,offset, bits,1,1,0,0, mask, value, name, value_name}#define awc_def_Stats_RID(o16,offset,name, value_name)\ {&aironet4500_RID_Select_32_stats,offset, 32,1,1,0,0, 0xffffffff, 0, name, value_name}#define awc_def_Stats_delta_RID(o16,offset,name, value_name)\ {&aironet4500_RID_Select_32_stats_delta,offset, 32,1,1,0,0, 0xffffffff, 0, name, value_name}#define awc_def_Stats_clear_RID(o16,offset,name, value_name)\ {&aironet4500_RID_Select_32_stats_delta,offset,32,1,1,0,0, 0xffffffff, 0, name,value_name}#define awc_def_Stats16_RID(offset,o32,name, value_name)\ {&aironet4500_RID_Select_16_stats,offset, 16,1,1,0,0, 0xffffffff, 0, name, value_name}#define awc_def_Stats16_delta_RID(offset,o32,name, value_name)\ {&aironet4500_RID_Select_16_stats_delta,offset, 16,1,1,0,0, 0xffffffff, 0, name,value_name}#define awc_def_Stats16_clear_RID(offset,o32,name, value_name)\ {&aironet4500_RID_Select_16_stats_delta,offset, 16,1,1,0,0, 0xffffffff, 0, name,value_name}#define aironet4500_RID_Select_strings {\{ 0xFF10, 0xffff, "General Configuration"},\{ 0xFF11, 0xffff, "Valid SSID list" },\{ 0xFF12, 0xffff, "Valid AP list"},\{ 0xFF13, 0xffff, "Driver name"},\{ 0xFF14, 0xffff, "Ethernet Protocol"},\{ 0xFF15, 0xffff, "WEP volatile"},\{ 0xFF16, 0xffff, "WEP nonvolatile"},\{ 0xFF17, 0xffff, "Modulation"},\{ 0xFF20, 0xffff, "Actual Configuration"},\{ 0xFF00, 0xffff, "Capabilities"},\{ 0xFF01, 0xffff, "AP Info"},\{ 0xFF02, 0xffff, "Radio Info"},\{ 0xFF50, 0xffff, "Status"},\{ 0xFF60, 0xffff, "Cumulative 16-bit Statistics"},\{ 0xFF61, 0xffff, "Delta 16-bit Statistics"},\{ 0xFF62, 0xffff, "Delta 16-bit Statistics and Clear"},\{ 0xFF68, 0xffff, "Cumulative 32-bit Statistics"},\{ 0xFF69, 0xffff, "Delta 32-bit Statistics "},\{ 0xFF6A, 0xffff, "Delta 32-bit Statistics and Clear"},\{ 0x0000, 0xffff, NULL}\}struct aironet4500_RID { const struct aironet4500_rid_selector * selector; const u32 offset; const u8 bits; const u8 array; const u32 units; const unsigned read_only:1; const unsigned null_terminated:1; const u32 mask; const u32 value; const char * name; const char * value_name; };struct aironet4500_RID_names{ struct aironet4500_RID rid; char *name;};struct aironet4500_RID_names_values{ struct aironet4500_RID rid; char *name; u32 mask; };struct awc_rid_dir{ const struct aironet4500_rid_selector * selector; const int size; const struct aironet4500_RID * rids; struct net_device * dev ; void * buff; int bufflen; // just checking};extern int awc_nof_rids;extern struct awc_rid_dir awc_rids[];struct awc_private { dev_node_t node; // somewhere back in times PCMCIA needed that int dummy_test; // left for cleanup // card rid inmemory copy struct awc_config config; // card RID mirrors struct awc_config general_config; // struct awc_SSIDs SSIDs; struct awc_fixed_APs fixed_APs; struct awc_driver_name driver_name; struct awc_enc_trans enc_trans; struct awc_cap capabilities; struct awc_status status; struct awc_AP AP; struct awc_Statistics_32 statistics; struct awc_Statistics_32 statistics_delta; struct awc_Statistics_32 statistics_delta_clear; struct awc_Statistics_16 statistics16; struct awc_Statistics_16 statistics16_delta; struct awc_Statistics_16 statistics16_delta_clear; struct awc_wep_key wep_volatile; struct awc_wep_key wep_nonvolatile; struct awc_modulation modulation; // here are just references to rids struct awc_rid_dir rid_dir[AWC_NOF_RIDS]; int rids_read; struct awc_bap bap0; struct awc_bap bap1; int sleeping_bap; struct awc_fid_queue tx_small_ready; struct awc_fid_queue tx_large_ready; struct awc_fid_queue tx_post_process; struct awc_fid_queue tx_in_transmit; my_spinlock_t queues_lock; struct awc_fid_queue rx_ready; struct awc_fid_queue rx_post_process; struct semaphore tx_buff_semaphore; volatile int tx_buffs_in_use; volatile int tx_small_buffs_in_use; volatile int tx_buffs_total; volatile int tx_small_buffs_total; int large_buff_mem; int small_buff_no; volatile int mac_enabled; u16 link_status; u8 link_status_changed; volatile int ejected; volatile int bh_running; volatile int bh_active; volatile long tx_chain_active; volatile u16 enabled_interrupts; volatile u16 waiting_interrupts; volatile int interrupt_count; // Command serialize stuff//changed to spinlock struct semaphore command_semaphore; my_spinlock_t both_bap_spinlock; // on SMP, card should theorethically live without that unsigned long both_bap_spinlock_flags; my_spinlock_t bap_setup_spinlock; // on SMP, card should theoretically live without that unsigned long bap_setup_spinlock_flags; my_spinlock_t command_issuing_spinlock; unsigned long command_issuing_spinlock_flags; my_spinlock_t interrupt_spinlock; volatile int unlock_command_postponed; struct awc_command cmd; long long async_command_start; volatile int command_semaphore_on; struct tq_struct immediate_bh; volatile int process_tx_results; u8 p2p[6]; u8 bssid[6]; int p2p_uc; int p2p_found; int p802_11_send; int simple_bridge; int force_rts_on_shorter; int force_tx_rate; int ip_tos_reliability_rts; int ip_tos_troughput_no_retries; int full_stats; int debug; struct net_device_stats stats; struct ctl_table * proc_table; void * bus; int card_type;};extern int awc_init(struct net_device * dev);extern void awc_reset(struct net_device *dev);extern int awc_config(struct net_device *dev);extern int awc_open(struct net_device *dev);extern void awc_tx_timeout(struct net_device *dev);extern int awc_start_xmit(struct sk_buff *, struct net_device *);extern void awc_interrupt(int irq, void *dev_id, struct pt_regs *regs);extern struct net_device_stats * awc_get_stats(struct net_device *dev);extern int awc_rx(struct net_device *dev, struct awc_fid * rx_fid);extern void awc_set_multicast_list(struct net_device *dev);extern int awc_change_mtu(struct net_device *dev, int new_mtu); extern int awc_close(struct net_device *dev);extern int awc_private_init(struct net_device * dev);extern int awc_register_proc(int (*awc_proc_set_device) (int),int (*awc_proc_unset_device)(int));extern int awc_unregister_proc(void);extern int (* awc_proc_set_fun) (int) ;extern int (* awc_proc_unset_fun) (int) ;extern int awc_interrupt_process(struct net_device * dev);extern int awc_readrid(struct net_device * dev, struct aironet4500_RID * rid, void *pBuf );extern int awc_writerid(struct net_device * dev, struct aironet4500_RID * rid, void *pBuf);extern int awc_readrid_dir(struct net_device * dev, struct awc_rid_dir * rid );extern int awc_writerid_dir(struct net_device * dev, struct awc_rid_dir * rid);extern int awc_tx_alloc(struct net_device * dev) ;extern int awc_tx_dealloc(struct net_device * dev);extern struct awc_fid *awc_tx_fid_lookup(struct net_device * dev, u16 fid);extern int awc_issue_soft_reset(struct net_device * dev);extern int awc_issue_noop(struct net_device * dev);extern int awc_dump_registers(struct net_device * dev);extern unsigned short awc_issue_command_and_block(struct awc_command * cmd);extern int awc_enable_MAC(struct net_device * dev);extern int awc_disable_MAC(struct net_device * dev);extern int awc_read_all_rids(struct net_device * dev);extern int awc_write_all_rids(struct net_device * dev);extern int awc_receive_packet(struct net_device * dev);extern int awc_transmit_packet(struct net_device * dev, struct awc_fid * tx_buff) ;extern int awc_tx_complete_check(struct net_device * dev);extern int awc_interrupt_process(struct net_device * dev);extern void awc_bh(struct net_device *dev);extern int awc_802_11_find_copy_path(struct net_device * dev, struct awc_fid * rx_buff);extern void awc_802_11_router_rx(struct net_device * dev,struct awc_fid * rx_buff);extern int awc_802_11_tx_find_path_and_post(struct net_device * dev, struct sk_buff * skb);extern void awc_802_11_after_tx_packet_to_card_write(struct net_device * dev, struct awc_fid * tx_buff);extern void awc_802_11_after_failed_tx_packet_to_card_write(struct net_device * dev,struct awc_fid * tx_buff);extern void awc_802_11_after_tx_complete(struct net_device * dev, struct awc_fid * tx_buff);extern void awc_802_11_failed_rx_copy(struct net_device * dev,struct awc_fid * rx_buff);extern int awc_tx_alloc(struct net_device * dev) ;extern int awc_tx_dealloc_fid(struct net_device * dev,struct awc_fid * fid);extern int awc_tx_dealloc(struct net_device * dev);extern struct awc_fid * awc_tx_fid_lookup_and_remove(struct net_device * dev, u16 fid_handle);extern int awc_queues_init(struct net_device * dev);extern int awc_queues_destroy(struct net_device * dev);extern int awc_rids_setup(struct net_device * dev);extern int awc_debug;extern int bap_sleep ;extern int bap_sleep_after_setup ;extern int sleep_before_command ;extern int bap_sleep_before_write;extern int sleep_in_command ;extern int both_bap_lock;extern int bap_setup_spinlock;extern int tx_queue_len ;extern int tx_rate;extern int awc_full_stats;#define MAX_AWCS 4extern struct net_device * aironet4500_devices[MAX_AWCS];#define AWC_DEBUG 1#ifdef AWC_DEBUG #define DEBUG(a,args...) if (awc_debug & a) printk( args) #define AWC_ENTRY_EXIT_DEBUG(a) if (awc_debug & 8) printk( a)#else #define DEBUG(a, args...) #define AWC_ENTRY_EXIT_DEBUG(a)#endif#endif /* AIRONET4500_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -