1 /* 2 * test mode interfaces for XRadio drivers 3 * 4 * Copyright (c) 2013 5 * Xradio Technology Co., Ltd. <www.xradiotech.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as 9 * published by the Free Software Foundation. 10 */ 11 12 #ifndef XR_NL80211_TESTMODE_MSG_COPY_H 13 #define XR_NL80211_TESTMODE_MSG_COPY_H 14 15 /* example command structure for test purposes */ 16 struct xr_msg_test_t { 17 int dummy; 18 }; 19 20 /* example reply structure for test purposes */ 21 struct xr_reply_test_t { 22 int dummy; 23 }; 24 25 /* example event structure for test purposes */ 26 struct xr_event_test_t { 27 int dummy; 28 }; 29 30 enum xr_msg_id { 31 XR_MSG_TEST = 0, /* for test purposes */ 32 XR_MSG_EVENT_TEST, /* for test purposes */ 33 XR_MSG_SET_SNAP_FRAME, 34 XR_MSG_EVENT_FRAME_DATA, 35 #ifdef CONFIG_XRADIO_TESTMODE 36 XR_MSG_GET_TX_POWER_LEVEL, 37 XR_MSG_GET_TX_POWER_RANGE, 38 XR_MSG_SET_ADVANCE_SCAN_ELEMS, 39 XR_MSG_SET_TX_QUEUE_PARAMS, 40 XR_MSG_START_STOP_TSM, 41 XR_MSG_GET_TSM_PARAMS, 42 XR_MSG_GET_ROAM_DELAY, 43 #endif /*CONFIG_XRADIO_TESTMODE*/ 44 XR_MSG_SET_POWER_SAVE, 45 /* Add new IDs here */ 46 47 XR_MSG_ID_MAX, 48 }; 49 50 enum xr_nl80211_testmode_data_attributes { 51 XR_TM_MSG_ID = 0x0001, /* u32 type containing the XR message ID */ 52 XR_TM_MSG_DATA, /* message payload */ 53 54 /* Max indicator so module test may add its own attributes */ 55 XR_TM_MSG_ATTR_MAX, 56 }; 57 58 /** 59 * xr_msg_set_snap_frame - set SNAP frame format 60 * @len: length of SNAP frame, if 0 SNAP frame disabled 61 * @frame: SNAP frame format 62 * 63 * In this structure is difference between user space because 64 * format and length have to be hidden 65 * 66 */ 67 struct xr_msg_set_snap_frame { 68 u8 len; 69 u8 frame[0]; 70 }; 71 72 #ifdef CONFIG_XRADIO_TESTMODE 73 /** 74 * xr_msg_set_txqueue_params - store Tx queue params 75 * @user_priority: User priority for which TSPEC negotiated 76 * @medium_time: Allowed medium time 77 * @expiry_time: The expiry time of MSDU 78 * 79 */ 80 struct xr_msg_set_txqueue_params { 81 u8 user_priority; 82 u16 medium_time; 83 u16 expiry_time; 84 }; 85 86 /** 87 * xr_tsm_stats - To retrieve the Transmit Stream Measurement stats 88 * @actual_msrmt_start_time: The TSF at the time at which the measurement 89 * started 90 * @msrmt_duration: Duration for measurement 91 * @peer_sta_addr: Peer STA address 92 * @tid: TID for which measurements were made 93 * @reporting_reason: Reason for report sent 94 * @txed_msdu_count: The number of MSDUs transmitted for the specified TID 95 * @msdu_discarded_count: The number of discarded MSDUs for the specified TID 96 * @msdu_failed_count: The number of failed MSDUs for the specified TID 97 * @multi_retry_count: The number of MSDUs which were retried 98 * @qos_cfpolls_lost_count: The number of QOS CF polls frames lost 99 * @avg_q_delay: Average queue delay 100 * @avg_transmit_delay: Average transmit delay 101 * @bin0_range: Delay range of the first bin (Bin 0) 102 * @bin0: bin0 transmit delay histogram 103 * @bin1: bin1 transmit delay histogram 104 * @bin2: bin2 transmit delay histogram 105 * @bin3: bin3 transmit delay histogram 106 * @bin4: bin4 transmit delay histogram 107 * @bin5: bin5 transmit delay histogram 108 * 109 */ 110 struct xr_tsm_stats { 111 u64 actual_msrmt_start_time; 112 u16 msrmt_duration; 113 u8 peer_sta_addr[6]; 114 u8 tid; 115 u8 reporting_reason; 116 u32 txed_msdu_count; 117 u32 msdu_discarded_count; 118 u32 msdu_failed_count; 119 u32 multi_retry_count; 120 u32 qos_cfpolls_lost_count; 121 u32 avg_q_delay; 122 u32 avg_transmit_delay; 123 u8 bin0_range; 124 u32 bin0; 125 u32 bin1; 126 u32 bin2; 127 u32 bin3; 128 u32 bin4; 129 u32 bin5; 130 } __packed; 131 132 133 /** 134 * xr_msg_set_start_stop_tsm - To start or stop collecting TSM metrics in 135 * xradio driver 136 * @start: To start or stop collecting TSM metrics 137 * @up: up for which metrics to be collected 138 * @packetization_delay: Packetization period for this TID 139 * 140 */ 141 struct xr_msg_start_stop_tsm { 142 u8 start; /*1: To start, 0: To stop*/ 143 u8 up; 144 u16 packetization_delay; 145 }; 146 147 /** 148 * power_save_elems - To enable/disable legacy power Save 149 */ 150 struct power_save_elems { 151 int powerSave; 152 }; 153 #endif /*CONFIG_XRADIO_TESTMODE*/ 154 155 #define XR_TM_MAX_ATTRIB_SIZE 1024 156 157 #endif /* XR_NL80211_TESTMODE_MSG_COPY_H*/ 158