1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533 |
- #include "athdefs.h"
- #include "osapi_linux.h"
- #include "a_types.h"
- #include "a_debug.h"
- #include "ol_if_athvar.h"
- #include "ol_defines.h"
- #include "htc_api.h"
- #include "htc_api.h"
- #include "dbglog_host.h"
- #include "wmi_unified_priv.h"
- #include "wmi_unified_param.h"
- #ifndef WMI_NON_TLV_SUPPORT
- #include "wmi_tlv_helper.h"
- #endif
- #include <linux/debugfs.h>
- #ifdef CONFIG_WIN
- #undef MS
- #define MS(_v, _f) (((_v) & _f##_MASK) >> _f##_LSB)
- #undef SM
- #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)
- #undef WO
- #define WO(_f) ((_f##_OFFSET) >> 2)
- #undef GET_FIELD
- #define GET_FIELD(_addr, _f) MS(*((A_UINT32 *)(_addr) + WO(_f)), _f)
- #undef SET_FIELD
- #define SET_FIELD(_addr, _f, _val) \
- (*((A_UINT32 *)(_addr) + WO(_f)) = \
- (*((A_UINT32 *)(_addr) + WO(_f)) & ~_f##_MASK) | SM(_val, _f))
- #define WMI_GET_FIELD(_msg_buf, _msg_type, _f) \
- GET_FIELD(_msg_buf, _msg_type ## _ ## _f)
- #define WMI_SET_FIELD(_msg_buf, _msg_type, _f, _val) \
- SET_FIELD(_msg_buf, _msg_type ## _ ## _f, _val)
- #define WMI_EP_APASS 0x0
- #define WMI_EP_LPASS 0x1
- #define WMI_EP_SENSOR 0x2
- typedef PREPACK struct {
- A_UINT32 commandId:24,
- reserved:2,
- plt_priv:6;
- } POSTPACK WMI_CMD_HDR;
- #define WMI_CMD_HDR_COMMANDID_LSB 0
- #define WMI_CMD_HDR_COMMANDID_MASK 0x00ffffff
- #define WMI_CMD_HDR_COMMANDID_OFFSET 0x00000000
- #define WMI_CMD_HDR_WMI_ENDPOINTID_MASK 0x03000000
- #define WMI_CMD_HDR_WMI_ENDPOINTID_OFFSET 24
- #define WMI_CMD_HDR_PLT_PRIV_LSB 24
- #define WMI_CMD_HDR_PLT_PRIV_MASK 0xff000000
- #define WMI_CMD_HDR_PLT_PRIV_OFFSET 0x00000000
- #endif
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0))
- static int qcacld_bp_seq_printf(struct seq_file *m, const char *f, ...)
- {
- va_list args;
- va_start(args, f);
- seq_printf(m, f, args);
- va_end(args);
- return m->count;
- }
- #define seq_printf(m, fmt, ...) qcacld_bp_seq_printf((m), fmt, ##__VA_ARGS__)
- #endif
- #define WMI_MIN_HEAD_ROOM 64
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- #ifndef MAX_WMI_INSTANCES
- #ifdef CONFIG_MCL
- #define MAX_WMI_INSTANCES 1
- #else
- #define MAX_WMI_INSTANCES 3
- #endif
- #define CUSTOM_MGMT_CMD_DATA_SIZE 4
- #endif
- #ifdef CONFIG_MCL
- uint32_t g_wmi_command_buf_idx = 0;
- struct wmi_command_debug wmi_command_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY];
- uint32_t g_wmi_command_tx_cmp_buf_idx = 0;
- struct wmi_command_debug
- wmi_command_tx_cmp_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY];
- uint32_t g_wmi_event_buf_idx = 0;
- struct wmi_event_debug wmi_event_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY];
- uint32_t g_wmi_rx_event_buf_idx = 0;
- struct wmi_event_debug wmi_rx_event_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY];
- #endif
- #define WMI_COMMAND_RECORD(h, a, b) { \
- if (wmi_log_max_entry <= \
- *(h->log_info.wmi_command_log_buf_info.p_buf_tail_idx)) \
- *(h->log_info.wmi_command_log_buf_info.p_buf_tail_idx) = 0;\
- ((struct wmi_command_debug *)h->log_info.wmi_command_log_buf_info.buf)\
- [*(h->log_info.wmi_command_log_buf_info.p_buf_tail_idx)]\
- .command = a; \
- qdf_mem_copy(((struct wmi_command_debug *)h->log_info. \
- wmi_command_log_buf_info.buf) \
- [*(h->log_info.wmi_command_log_buf_info.p_buf_tail_idx)].data,\
- b, wmi_record_max_length); \
- ((struct wmi_command_debug *)h->log_info.wmi_command_log_buf_info.buf)\
- [*(h->log_info.wmi_command_log_buf_info.p_buf_tail_idx)].\
- time = qdf_get_log_timestamp(); \
- (*(h->log_info.wmi_command_log_buf_info.p_buf_tail_idx))++; \
- h->log_info.wmi_command_log_buf_info.length++; \
- }
- #define WMI_COMMAND_TX_CMP_RECORD(h, a, b) { \
- if (wmi_log_max_entry <= \
- *(h->log_info.wmi_command_tx_cmp_log_buf_info.p_buf_tail_idx))\
- *(h->log_info.wmi_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx) = 0; \
- ((struct wmi_command_debug *)h->log_info. \
- wmi_command_tx_cmp_log_buf_info.buf) \
- [*(h->log_info.wmi_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx)]. \
- command = a; \
- qdf_mem_copy(((struct wmi_command_debug *)h->log_info. \
- wmi_command_tx_cmp_log_buf_info.buf) \
- [*(h->log_info.wmi_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx)]. \
- data, b, wmi_record_max_length); \
- ((struct wmi_command_debug *)h->log_info. \
- wmi_command_tx_cmp_log_buf_info.buf) \
- [*(h->log_info.wmi_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx)]. \
- time = qdf_get_log_timestamp(); \
- (*(h->log_info.wmi_command_tx_cmp_log_buf_info.p_buf_tail_idx))++;\
- h->log_info.wmi_command_tx_cmp_log_buf_info.length++; \
- }
- #define WMI_EVENT_RECORD(h, a, b) { \
- if (wmi_log_max_entry <= \
- *(h->log_info.wmi_event_log_buf_info.p_buf_tail_idx)) \
- *(h->log_info.wmi_event_log_buf_info.p_buf_tail_idx) = 0;\
- ((struct wmi_event_debug *)h->log_info.wmi_event_log_buf_info.buf)\
- [*(h->log_info.wmi_event_log_buf_info.p_buf_tail_idx)]. \
- event = a; \
- qdf_mem_copy(((struct wmi_event_debug *)h->log_info. \
- wmi_event_log_buf_info.buf) \
- [*(h->log_info.wmi_event_log_buf_info.p_buf_tail_idx)].data, b,\
- wmi_record_max_length); \
- ((struct wmi_event_debug *)h->log_info.wmi_event_log_buf_info.buf)\
- [*(h->log_info.wmi_event_log_buf_info.p_buf_tail_idx)].time =\
- qdf_get_log_timestamp(); \
- (*(h->log_info.wmi_event_log_buf_info.p_buf_tail_idx))++; \
- h->log_info.wmi_event_log_buf_info.length++; \
- }
- #define WMI_RX_EVENT_RECORD(h, a, b) { \
- if (wmi_log_max_entry <= \
- *(h->log_info.wmi_rx_event_log_buf_info.p_buf_tail_idx))\
- *(h->log_info.wmi_rx_event_log_buf_info.p_buf_tail_idx) = 0;\
- ((struct wmi_event_debug *)h->log_info.wmi_rx_event_log_buf_info.buf)\
- [*(h->log_info.wmi_rx_event_log_buf_info.p_buf_tail_idx)].\
- event = a; \
- qdf_mem_copy(((struct wmi_event_debug *)h->log_info. \
- wmi_rx_event_log_buf_info.buf) \
- [*(h->log_info.wmi_rx_event_log_buf_info.p_buf_tail_idx)].\
- data, b, wmi_record_max_length); \
- ((struct wmi_event_debug *)h->log_info.wmi_rx_event_log_buf_info.buf)\
- [*(h->log_info.wmi_rx_event_log_buf_info.p_buf_tail_idx)].\
- time = qdf_get_log_timestamp(); \
- (*(h->log_info.wmi_rx_event_log_buf_info.p_buf_tail_idx))++; \
- h->log_info.wmi_rx_event_log_buf_info.length++; \
- }
- #ifdef CONFIG_MCL
- uint32_t g_wmi_mgmt_command_buf_idx = 0;
- struct
- wmi_command_debug wmi_mgmt_command_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY];
- uint32_t g_wmi_mgmt_command_tx_cmp_buf_idx = 0;
- struct wmi_command_debug
- wmi_mgmt_command_tx_cmp_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY];
- uint32_t g_wmi_mgmt_event_buf_idx = 0;
- struct wmi_event_debug
- wmi_mgmt_event_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY];
- #endif
- #define WMI_MGMT_COMMAND_RECORD(h, a, b) { \
- if (wmi_mgmt_log_max_entry <= \
- *(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)) \
- *(h->log_info.wmi_mgmt_command_log_buf_info. \
- p_buf_tail_idx) = 0; \
- ((struct wmi_command_debug *)h->log_info. \
- wmi_mgmt_command_log_buf_info.buf) \
- [*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)].\
- command = a; \
- qdf_mem_copy(((struct wmi_command_debug *)h->log_info. \
- wmi_mgmt_command_log_buf_info.buf) \
- [*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)].\
- data, b, \
- wmi_record_max_length); \
- ((struct wmi_command_debug *)h->log_info. \
- wmi_mgmt_command_log_buf_info.buf) \
- [*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)].\
- time = qdf_get_log_timestamp(); \
- (*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx))++;\
- h->log_info.wmi_mgmt_command_log_buf_info.length++; \
- }
- #define WMI_MGMT_COMMAND_TX_CMP_RECORD(h, a, b) { \
- if (wmi_mgmt_log_max_entry <= \
- *(h->log_info.wmi_mgmt_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx)) \
- *(h->log_info.wmi_mgmt_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx) = 0; \
- ((struct wmi_command_debug *)h->log_info. \
- wmi_mgmt_command_tx_cmp_log_buf_info.buf) \
- [*(h->log_info.wmi_mgmt_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx)].command = a; \
- qdf_mem_copy(((struct wmi_command_debug *)h->log_info. \
- wmi_mgmt_command_tx_cmp_log_buf_info.buf)\
- [*(h->log_info.wmi_mgmt_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx)].data, b, \
- wmi_record_max_length); \
- ((struct wmi_command_debug *)h->log_info. \
- wmi_mgmt_command_tx_cmp_log_buf_info.buf) \
- [*(h->log_info.wmi_mgmt_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx)].time = \
- qdf_get_log_timestamp(); \
- (*(h->log_info.wmi_mgmt_command_tx_cmp_log_buf_info. \
- p_buf_tail_idx))++; \
- h->log_info.wmi_mgmt_command_tx_cmp_log_buf_info.length++; \
- }
- #define WMI_MGMT_EVENT_RECORD(h, a, b) { \
- if (wmi_mgmt_log_max_entry <= \
- *(h->log_info.wmi_mgmt_event_log_buf_info.p_buf_tail_idx))\
- *(h->log_info.wmi_mgmt_event_log_buf_info.p_buf_tail_idx) = 0;\
- ((struct wmi_event_debug *)h->log_info.wmi_mgmt_event_log_buf_info.buf)\
- [*(h->log_info.wmi_mgmt_event_log_buf_info.p_buf_tail_idx)]\
- .event = a; \
- qdf_mem_copy(((struct wmi_event_debug *)h->log_info. \
- wmi_mgmt_event_log_buf_info.buf) \
- [*(h->log_info.wmi_mgmt_event_log_buf_info.p_buf_tail_idx)].\
- data, b, wmi_record_max_length); \
- ((struct wmi_event_debug *)h->log_info.wmi_mgmt_event_log_buf_info.buf)\
- [*(h->log_info.wmi_mgmt_event_log_buf_info.p_buf_tail_idx)].\
- time = qdf_get_log_timestamp(); \
- (*(h->log_info.wmi_mgmt_event_log_buf_info.p_buf_tail_idx))++; \
- h->log_info.wmi_mgmt_event_log_buf_info.length++; \
- }
- uint32_t wmi_log_max_entry = WMI_EVENT_DEBUG_MAX_ENTRY;
- uint32_t wmi_mgmt_log_max_entry = WMI_MGMT_EVENT_DEBUG_MAX_ENTRY;
- uint32_t wmi_record_max_length = WMI_EVENT_DEBUG_ENTRY_MAX_LENGTH;
- uint32_t wmi_display_size = 100;
- static uint8_t *wmi_id_to_name(uint32_t wmi_command);
- #ifdef CONFIG_MCL
- static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
- {
- struct wmi_log_buf_t *cmd_log_buf =
- &wmi_handle->log_info.wmi_command_log_buf_info;
- struct wmi_log_buf_t *cmd_tx_cmpl_log_buf =
- &wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info;
- struct wmi_log_buf_t *event_log_buf =
- &wmi_handle->log_info.wmi_event_log_buf_info;
- struct wmi_log_buf_t *rx_event_log_buf =
- &wmi_handle->log_info.wmi_rx_event_log_buf_info;
- struct wmi_log_buf_t *mgmt_cmd_log_buf =
- &wmi_handle->log_info.wmi_mgmt_command_log_buf_info;
- struct wmi_log_buf_t *mgmt_cmd_tx_cmp_log_buf =
- &wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info;
- struct wmi_log_buf_t *mgmt_event_log_buf =
- &wmi_handle->log_info.wmi_mgmt_event_log_buf_info;
-
- cmd_log_buf->length = 0;
- cmd_log_buf->buf_tail_idx = 0;
- cmd_log_buf->buf = wmi_command_log_buffer;
- cmd_log_buf->p_buf_tail_idx = &g_wmi_command_buf_idx;
-
- cmd_tx_cmpl_log_buf->length = 0;
- cmd_tx_cmpl_log_buf->buf_tail_idx = 0;
- cmd_tx_cmpl_log_buf->buf = wmi_command_tx_cmp_log_buffer;
- cmd_tx_cmpl_log_buf->p_buf_tail_idx = &g_wmi_command_tx_cmp_buf_idx;
-
- event_log_buf->length = 0;
- event_log_buf->buf_tail_idx = 0;
- event_log_buf->buf = wmi_event_log_buffer;
- event_log_buf->p_buf_tail_idx = &g_wmi_event_buf_idx;
-
- rx_event_log_buf->length = 0;
- rx_event_log_buf->buf_tail_idx = 0;
- rx_event_log_buf->buf = wmi_rx_event_log_buffer;
- rx_event_log_buf->p_buf_tail_idx = &g_wmi_rx_event_buf_idx;
-
- mgmt_cmd_log_buf->length = 0;
- mgmt_cmd_log_buf->buf_tail_idx = 0;
- mgmt_cmd_log_buf->buf = wmi_mgmt_command_log_buffer;
- mgmt_cmd_log_buf->p_buf_tail_idx = &g_wmi_mgmt_command_buf_idx;
-
- mgmt_cmd_tx_cmp_log_buf->length = 0;
- mgmt_cmd_tx_cmp_log_buf->buf_tail_idx = 0;
- mgmt_cmd_tx_cmp_log_buf->buf = wmi_mgmt_command_tx_cmp_log_buffer;
- mgmt_cmd_tx_cmp_log_buf->p_buf_tail_idx =
- &g_wmi_mgmt_command_tx_cmp_buf_idx;
-
- mgmt_event_log_buf->length = 0;
- mgmt_event_log_buf->buf_tail_idx = 0;
- mgmt_event_log_buf->buf = wmi_mgmt_event_log_buffer;
- mgmt_event_log_buf->p_buf_tail_idx = &g_wmi_mgmt_event_buf_idx;
- qdf_spinlock_create(&wmi_handle->log_info.wmi_record_lock);
- wmi_handle->log_info.wmi_logging_enable = 1;
- return QDF_STATUS_SUCCESS;
- }
- #else
- static QDF_STATUS wmi_log_init(struct wmi_unified *wmi_handle)
- {
- struct wmi_log_buf_t *cmd_log_buf =
- &wmi_handle->log_info.wmi_command_log_buf_info;
- struct wmi_log_buf_t *cmd_tx_cmpl_log_buf =
- &wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info;
- struct wmi_log_buf_t *event_log_buf =
- &wmi_handle->log_info.wmi_event_log_buf_info;
- struct wmi_log_buf_t *rx_event_log_buf =
- &wmi_handle->log_info.wmi_rx_event_log_buf_info;
- struct wmi_log_buf_t *mgmt_cmd_log_buf =
- &wmi_handle->log_info.wmi_mgmt_command_log_buf_info;
- struct wmi_log_buf_t *mgmt_cmd_tx_cmp_log_buf =
- &wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info;
- struct wmi_log_buf_t *mgmt_event_log_buf =
- &wmi_handle->log_info.wmi_mgmt_event_log_buf_info;
- wmi_handle->log_info.wmi_logging_enable = 0;
-
- cmd_log_buf->length = 0;
- cmd_log_buf->buf_tail_idx = 0;
- cmd_log_buf->buf = (struct wmi_command_debug *) qdf_mem_malloc(
- wmi_log_max_entry * sizeof(struct wmi_command_debug));
- if (!cmd_log_buf->buf) {
- qdf_print("no memory for WMI command log buffer..\n");
- return QDF_STATUS_E_NOMEM;
- }
- cmd_log_buf->p_buf_tail_idx = &cmd_log_buf->buf_tail_idx;
-
- cmd_tx_cmpl_log_buf->length = 0;
- cmd_tx_cmpl_log_buf->buf_tail_idx = 0;
- cmd_tx_cmpl_log_buf->buf = (struct wmi_command_debug *) qdf_mem_malloc(
- wmi_log_max_entry * sizeof(struct wmi_command_debug));
- if (!cmd_tx_cmpl_log_buf->buf) {
- qdf_print("no memory for WMI Command Tx Complete log buffer..\n");
- return QDF_STATUS_E_NOMEM;
- }
- cmd_tx_cmpl_log_buf->p_buf_tail_idx =
- &cmd_tx_cmpl_log_buf->buf_tail_idx;
-
- event_log_buf->length = 0;
- event_log_buf->buf_tail_idx = 0;
- event_log_buf->buf = (struct wmi_event_debug *) qdf_mem_malloc(
- wmi_log_max_entry * sizeof(struct wmi_event_debug));
- if (!event_log_buf->buf) {
- qdf_print("no memory for WMI Event log buffer..\n");
- return QDF_STATUS_E_NOMEM;
- }
- event_log_buf->p_buf_tail_idx = &event_log_buf->buf_tail_idx;
-
- rx_event_log_buf->length = 0;
- rx_event_log_buf->buf_tail_idx = 0;
- rx_event_log_buf->buf = (struct wmi_event_debug *) qdf_mem_malloc(
- wmi_log_max_entry * sizeof(struct wmi_event_debug));
- if (!rx_event_log_buf->buf) {
- qdf_print("no memory for WMI Event Rx log buffer..\n");
- return QDF_STATUS_E_NOMEM;
- }
- rx_event_log_buf->p_buf_tail_idx = &rx_event_log_buf->buf_tail_idx;
-
- mgmt_cmd_log_buf->length = 0;
- mgmt_cmd_log_buf->buf_tail_idx = 0;
- mgmt_cmd_log_buf->buf = (struct wmi_command_debug *) qdf_mem_malloc(
- wmi_mgmt_log_max_entry *
- sizeof(struct wmi_command_debug));
- if (!mgmt_cmd_log_buf->buf) {
- qdf_print("no memory for WMI Management Command log buffer..\n");
- return QDF_STATUS_E_NOMEM;
- }
- mgmt_cmd_log_buf->p_buf_tail_idx = &mgmt_cmd_log_buf->buf_tail_idx;
-
- mgmt_cmd_tx_cmp_log_buf->length = 0;
- mgmt_cmd_tx_cmp_log_buf->buf_tail_idx = 0;
- mgmt_cmd_tx_cmp_log_buf->buf = (struct wmi_command_debug *)
- qdf_mem_malloc(
- wmi_mgmt_log_max_entry *
- sizeof(struct wmi_command_debug));
- if (!mgmt_cmd_tx_cmp_log_buf->buf) {
- qdf_print("no memory for WMI Management Command Tx complete log buffer..\n");
- return QDF_STATUS_E_NOMEM;
- }
- mgmt_cmd_tx_cmp_log_buf->p_buf_tail_idx =
- &mgmt_cmd_tx_cmp_log_buf->buf_tail_idx;
-
- mgmt_event_log_buf->length = 0;
- mgmt_event_log_buf->buf_tail_idx = 0;
- mgmt_event_log_buf->buf = (struct wmi_event_debug *) qdf_mem_malloc(
- wmi_mgmt_log_max_entry *
- sizeof(struct wmi_event_debug));
- if (!mgmt_event_log_buf->buf) {
- qdf_print("no memory for WMI Management Event log buffer..\n");
- return QDF_STATUS_E_NOMEM;
- }
- mgmt_event_log_buf->p_buf_tail_idx = &mgmt_event_log_buf->buf_tail_idx;
- qdf_spinlock_create(&wmi_handle->log_info.wmi_record_lock);
- wmi_handle->log_info.wmi_logging_enable = 1;
- return QDF_STATUS_SUCCESS;
- }
- #endif
- #ifndef CONFIG_MCL
- static inline void wmi_log_buffer_free(struct wmi_unified *wmi_handle)
- {
- if (wmi_handle->log_info.wmi_command_log_buf_info.buf)
- qdf_mem_free(wmi_handle->log_info.wmi_command_log_buf_info.buf);
- if (wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info.buf)
- qdf_mem_free(
- wmi_handle->log_info.wmi_command_tx_cmp_log_buf_info.buf);
- if (wmi_handle->log_info.wmi_event_log_buf_info.buf)
- qdf_mem_free(wmi_handle->log_info.wmi_event_log_buf_info.buf);
- if (wmi_handle->log_info.wmi_rx_event_log_buf_info.buf)
- qdf_mem_free(
- wmi_handle->log_info.wmi_rx_event_log_buf_info.buf);
- if (wmi_handle->log_info.wmi_mgmt_command_log_buf_info.buf)
- qdf_mem_free(
- wmi_handle->log_info.wmi_mgmt_command_log_buf_info.buf);
- if (wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info.buf)
- qdf_mem_free(
- wmi_handle->log_info.wmi_mgmt_command_tx_cmp_log_buf_info.buf);
- if (wmi_handle->log_info.wmi_mgmt_event_log_buf_info.buf)
- qdf_mem_free(
- wmi_handle->log_info.wmi_mgmt_event_log_buf_info.buf);
- wmi_handle->log_info.wmi_logging_enable = 0;
- qdf_spinlock_destroy(&wmi_handle->log_info.wmi_record_lock);
- }
- #else
- static inline void wmi_log_buffer_free(struct wmi_unified *wmi_handle)
- {
-
- }
- #endif
- #ifdef CONFIG_MCL
- const int8_t * const debugfs_dir[MAX_WMI_INSTANCES] = {"WMI0"};
- #else
- const int8_t * const debugfs_dir[MAX_WMI_INSTANCES] = {"WMI0", "WMI1", "WMI2"};
- #endif
- #define GENERATE_COMMAND_DEBUG_SHOW_FUNCS(func_base, wmi_ring_size) \
- static int debug_wmi_##func_base##_show(struct seq_file *m, \
- void *v) \
- { \
- wmi_unified_t wmi_handle = (wmi_unified_t) m->private; \
- struct wmi_log_buf_t *wmi_log = \
- &wmi_handle->log_info.wmi_##func_base##_buf_info;\
- int pos, nread, outlen; \
- int i; \
- \
- qdf_spin_lock(&wmi_handle->log_info.wmi_record_lock); \
- if (!wmi_log->length) { \
- qdf_spin_unlock(&wmi_handle->log_info.wmi_record_lock);\
- return seq_printf(m, \
- "no elements to read from ring buffer!\n"); \
- } \
- \
- if (wmi_log->length <= wmi_ring_size) \
- nread = wmi_log->length; \
- else \
- nread = wmi_ring_size; \
- \
- if (*(wmi_log->p_buf_tail_idx) == 0) \
- \
- pos = wmi_ring_size - 1; \
- else \
- pos = *(wmi_log->p_buf_tail_idx) - 1; \
- \
- outlen = seq_printf(m, "Length = %d\n", wmi_log->length);\
- qdf_spin_unlock(&wmi_handle->log_info.wmi_record_lock); \
- while (nread--) { \
- struct wmi_command_debug *wmi_record; \
- \
- wmi_record = (struct wmi_command_debug *) \
- &(((struct wmi_command_debug *)wmi_log->buf)[pos]);\
- outlen += seq_printf(m, "CMD ID = %x\n", \
- (wmi_record->command)); \
- outlen += seq_printf(m, "CMD = "); \
- for (i = 0; i < (wmi_record_max_length/ \
- sizeof(uint32_t)); i++) \
- outlen += seq_printf(m, "%x ", \
- wmi_record->data[i]); \
- outlen += seq_printf(m, "\n"); \
- \
- if (pos == 0) \
- pos = wmi_ring_size - 1; \
- else \
- pos--; \
- } \
- \
- return outlen; \
- } \
- #define GENERATE_EVENT_DEBUG_SHOW_FUNCS(func_base, wmi_ring_size) \
- static int debug_wmi_##func_base##_show(struct seq_file *m, \
- void *v) \
- { \
- wmi_unified_t wmi_handle = (wmi_unified_t) m->private; \
- struct wmi_log_buf_t *wmi_log = \
- &wmi_handle->log_info.wmi_##func_base##_buf_info;\
- int pos, nread, outlen; \
- int i; \
- \
- qdf_spin_lock(&wmi_handle->log_info.wmi_record_lock); \
- if (!wmi_log->length) { \
- qdf_spin_unlock(&wmi_handle->log_info.wmi_record_lock);\
- return seq_printf(m, \
- "no elements to read from ring buffer!\n"); \
- } \
- \
- if (wmi_log->length <= wmi_ring_size) \
- nread = wmi_log->length; \
- else \
- nread = wmi_ring_size; \
- \
- if (*(wmi_log->p_buf_tail_idx) == 0) \
- \
- pos = wmi_ring_size - 1; \
- else \
- pos = *(wmi_log->p_buf_tail_idx) - 1; \
- \
- outlen = seq_printf(m, "Length = %d\n", wmi_log->length);\
- qdf_spin_unlock(&wmi_handle->log_info.wmi_record_lock); \
- while (nread--) { \
- struct wmi_event_debug *wmi_record; \
- \
- wmi_record = (struct wmi_event_debug *) \
- &(((struct wmi_event_debug *)wmi_log->buf)[pos]);\
- outlen += seq_printf(m, "Event ID = %x\n", \
- (wmi_record->event)); \
- outlen += seq_printf(m, "CMD = "); \
- for (i = 0; i < (wmi_record_max_length/ \
- sizeof(uint32_t)); i++) \
- outlen += seq_printf(m, "%x ", \
- wmi_record->data[i]); \
- outlen += seq_printf(m, "\n"); \
- \
- if (pos == 0) \
- pos = wmi_ring_size - 1; \
- else \
- pos--; \
- } \
- \
- return outlen; \
- }
- GENERATE_COMMAND_DEBUG_SHOW_FUNCS(command_log, wmi_display_size);
- GENERATE_COMMAND_DEBUG_SHOW_FUNCS(command_tx_cmp_log, wmi_display_size);
- GENERATE_EVENT_DEBUG_SHOW_FUNCS(event_log, wmi_display_size);
- GENERATE_EVENT_DEBUG_SHOW_FUNCS(rx_event_log, wmi_display_size);
- GENERATE_COMMAND_DEBUG_SHOW_FUNCS(mgmt_command_log, wmi_display_size);
- GENERATE_COMMAND_DEBUG_SHOW_FUNCS(mgmt_command_tx_cmp_log,
- wmi_display_size);
- GENERATE_EVENT_DEBUG_SHOW_FUNCS(mgmt_event_log, wmi_display_size);
- static int debug_wmi_enable_show(struct seq_file *m, void *v)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) m->private;
- return seq_printf(m, "%d\n", wmi_handle->log_info.wmi_logging_enable);
- }
- static int debug_wmi_log_size_show(struct seq_file *m, void *v)
- {
- seq_printf(m, "WMI command/event log max size:%d\n", wmi_log_max_entry);
- return seq_printf(m, "WMI management command/events log max size:%d\n",
- wmi_mgmt_log_max_entry);
- }
- #define GENERATE_DEBUG_WRITE_FUNCS(func_base, wmi_ring_size, wmi_record_type)\
- static ssize_t debug_wmi_##func_base##_write(struct file *file, \
- const char __user *buf, \
- size_t count, loff_t *ppos) \
- { \
- int k, ret; \
- wmi_unified_t wmi_handle = file->private_data; \
- struct wmi_log_buf_t *wmi_log = &wmi_handle->log_info. \
- wmi_##func_base##_buf_info; \
- \
- ret = sscanf(buf, "%d", &k); \
- if ((ret != 1) || (k != 0)) { \
- qdf_print("Wrong input, echo 0 to clear the wmi buffer\n");\
- return -EINVAL; \
- } \
- \
- qdf_spin_lock(&wmi_handle->log_info.wmi_record_lock); \
- qdf_mem_zero(wmi_log->buf, wmi_ring_size * \
- sizeof(struct wmi_record_type)); \
- wmi_log->length = 0; \
- *(wmi_log->p_buf_tail_idx) = 0; \
- qdf_spin_unlock(&wmi_handle->log_info.wmi_record_lock); \
- \
- return count; \
- }
- GENERATE_DEBUG_WRITE_FUNCS(command_log, wmi_log_max_entry,
- wmi_command_debug);
- GENERATE_DEBUG_WRITE_FUNCS(command_tx_cmp_log, wmi_log_max_entry,
- wmi_command_debug);
- GENERATE_DEBUG_WRITE_FUNCS(event_log, wmi_log_max_entry,
- wmi_event_debug);
- GENERATE_DEBUG_WRITE_FUNCS(rx_event_log, wmi_log_max_entry,
- wmi_event_debug);
- GENERATE_DEBUG_WRITE_FUNCS(mgmt_command_log, wmi_mgmt_log_max_entry,
- wmi_command_debug);
- GENERATE_DEBUG_WRITE_FUNCS(mgmt_command_tx_cmp_log,
- wmi_mgmt_log_max_entry, wmi_command_debug);
- GENERATE_DEBUG_WRITE_FUNCS(mgmt_event_log, wmi_mgmt_log_max_entry,
- wmi_event_debug);
- static ssize_t debug_wmi_enable_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
- {
- wmi_unified_t wmi_handle = file->private_data;
- int k, ret;
- ret = sscanf(buf, "%d", &k);
- if ((ret != 1) || ((k != 0) && (k != 1)))
- return -EINVAL;
- wmi_handle->log_info.wmi_logging_enable = k;
- return count;
- }
- static ssize_t debug_wmi_log_size_write(struct file *file,
- const char __user *buf, size_t count, loff_t *ppos)
- {
- return -EINVAL;
- }
- struct wmi_debugfs_info {
- const char *name;
- struct dentry *de[MAX_WMI_INSTANCES];
- const struct file_operations *ops;
- };
- #define DEBUG_FOO(func_base) { .name = #func_base, \
- .ops = &debug_##func_base##_ops }
- #define GENERATE_DEBUG_STRUCTS(func_base) \
- static int debug_##func_base##_open(struct inode *inode, \
- struct file *file) \
- { \
- return single_open(file, debug_##func_base##_show, \
- inode->i_private); \
- } \
- \
- \
- static struct file_operations debug_##func_base##_ops = { \
- .open = debug_##func_base##_open, \
- .read = seq_read, \
- .llseek = seq_lseek, \
- .write = debug_##func_base##_write, \
- .release = single_release, \
- };
- GENERATE_DEBUG_STRUCTS(wmi_command_log);
- GENERATE_DEBUG_STRUCTS(wmi_command_tx_cmp_log);
- GENERATE_DEBUG_STRUCTS(wmi_event_log);
- GENERATE_DEBUG_STRUCTS(wmi_rx_event_log);
- GENERATE_DEBUG_STRUCTS(wmi_mgmt_command_log);
- GENERATE_DEBUG_STRUCTS(wmi_mgmt_command_tx_cmp_log);
- GENERATE_DEBUG_STRUCTS(wmi_mgmt_event_log);
- GENERATE_DEBUG_STRUCTS(wmi_enable);
- GENERATE_DEBUG_STRUCTS(wmi_log_size);
- struct wmi_debugfs_info wmi_debugfs_infos[] = {
- DEBUG_FOO(wmi_command_log),
- DEBUG_FOO(wmi_command_tx_cmp_log),
- DEBUG_FOO(wmi_event_log),
- DEBUG_FOO(wmi_rx_event_log),
- DEBUG_FOO(wmi_mgmt_command_log),
- DEBUG_FOO(wmi_mgmt_command_tx_cmp_log),
- DEBUG_FOO(wmi_mgmt_event_log),
- DEBUG_FOO(wmi_enable),
- DEBUG_FOO(wmi_log_size),
- };
- #define NUM_DEBUG_INFOS (sizeof(wmi_debugfs_infos) / \
- sizeof(wmi_debugfs_infos[0]))
- static void wmi_debugfs_create(wmi_unified_t wmi_handle,
- struct dentry *par_entry, int id)
- {
- int i;
- if (par_entry == NULL || (id < 0) || (id >= MAX_WMI_INSTANCES))
- goto out;
- for (i = 0; i < NUM_DEBUG_INFOS; ++i) {
- wmi_debugfs_infos[i].de[id] = debugfs_create_file(
- wmi_debugfs_infos[i].name, 0644, par_entry,
- wmi_handle, wmi_debugfs_infos[i].ops);
- if (wmi_debugfs_infos[i].de[id] == NULL) {
- qdf_print("%s: debug Entry creation failed!\n",
- __func__);
- goto out;
- }
- }
- return;
- out:
- qdf_print("%s: debug Entry creation failed!\n", __func__);
- wmi_log_buffer_free(wmi_handle);
- return;
- }
- static void wmi_debugfs_remove(wmi_unified_t wmi_handle)
- {
- int i;
- struct dentry *dentry = wmi_handle->log_info.wmi_log_debugfs_dir;
- int id = wmi_handle->log_info.wmi_instance_id;
- if (dentry && (!(id < 0) || (id >= MAX_WMI_INSTANCES))) {
- for (i = 0; i < NUM_DEBUG_INFOS; ++i) {
- if (wmi_debugfs_infos[i].de[id])
- wmi_debugfs_infos[i].de[id] = NULL;
- }
- }
- if (dentry)
- debugfs_remove_recursive(dentry);
- }
- static QDF_STATUS wmi_debugfs_init(wmi_unified_t wmi_handle)
- {
- static int wmi_index;
- if (wmi_index < MAX_WMI_INSTANCES)
- wmi_handle->log_info.wmi_log_debugfs_dir =
- debugfs_create_dir(debugfs_dir[wmi_index], NULL);
- if (wmi_handle->log_info.wmi_log_debugfs_dir == NULL) {
- qdf_print("error while creating debugfs dir for %s\n",
- debugfs_dir[wmi_index]);
- return QDF_STATUS_E_FAILURE;
- }
- wmi_debugfs_create(wmi_handle, wmi_handle->log_info.wmi_log_debugfs_dir,
- wmi_index);
- wmi_handle->log_info.wmi_instance_id = wmi_index++;
- return QDF_STATUS_SUCCESS;
- }
- void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, uint32_t cmd,
- void *header, uint32_t vdev_id, uint32_t chanfreq)
- {
- uint32_t data[CUSTOM_MGMT_CMD_DATA_SIZE];
- data[0] = ((struct wmi_command_header *)header)->type;
- data[1] = ((struct wmi_command_header *)header)->sub_type;
- data[2] = vdev_id;
- data[3] = chanfreq;
- qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
- WMI_MGMT_COMMAND_RECORD(wmi_handle, cmd, data);
- qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
- }
- #else
- static void wmi_debugfs_remove(wmi_unified_t wmi_handle) { }
- void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, uint32_t cmd,
- void *header, uint32_t vdev_id, uint32_t chanfreq) { }
- #endif
- int wmi_get_host_credits(wmi_unified_t wmi_handle);
- #ifdef MEMORY_DEBUG
- wmi_buf_t
- wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint16_t len, uint8_t *file_name,
- uint32_t line_num)
- {
- wmi_buf_t wmi_buf;
- if (roundup(len + WMI_MIN_HEAD_ROOM, 4) > wmi_handle->max_msg_len) {
- QDF_ASSERT(0);
- return NULL;
- }
- wmi_buf = qdf_nbuf_alloc_debug(NULL,
- roundup(len + WMI_MIN_HEAD_ROOM, 4),
- WMI_MIN_HEAD_ROOM, 4, false, file_name,
- line_num);
- if (!wmi_buf)
- return NULL;
-
- OS_MEMZERO(qdf_nbuf_data(wmi_buf), len);
-
- qdf_nbuf_set_pktlen(wmi_buf, len);
- return wmi_buf;
- }
- void wmi_buf_free(wmi_buf_t net_buf)
- {
- qdf_nbuf_free(net_buf);
- }
- #else
- wmi_buf_t wmi_buf_alloc(wmi_unified_t wmi_handle, uint16_t len)
- {
- wmi_buf_t wmi_buf;
- if (roundup(len + WMI_MIN_HEAD_ROOM, 4) > wmi_handle->max_msg_len) {
- QDF_ASSERT(0);
- return NULL;
- }
- wmi_buf = qdf_nbuf_alloc(NULL, roundup(len + WMI_MIN_HEAD_ROOM, 4),
- WMI_MIN_HEAD_ROOM, 4, false);
- if (!wmi_buf)
- return NULL;
-
- OS_MEMZERO(qdf_nbuf_data(wmi_buf), len);
-
- qdf_nbuf_set_pktlen(wmi_buf, len);
- return wmi_buf;
- }
- void wmi_buf_free(wmi_buf_t net_buf)
- {
- qdf_nbuf_free(net_buf);
- }
- #endif
- uint16_t wmi_get_max_msg_len(wmi_unified_t wmi_handle)
- {
- return wmi_handle->max_msg_len - WMI_MIN_HEAD_ROOM;
- }
- #ifdef CONFIG_MCL
- static uint8_t *wmi_id_to_name(uint32_t wmi_command)
- {
- switch (wmi_command) {
-
- CASE_RETURN_STRING(WMI_INIT_CMDID);
-
-
- CASE_RETURN_STRING(WMI_START_SCAN_CMDID);
-
- CASE_RETURN_STRING(WMI_STOP_SCAN_CMDID);
-
- CASE_RETURN_STRING(WMI_SCAN_CHAN_LIST_CMDID);
-
- CASE_RETURN_STRING(WMI_SCAN_SCH_PRIO_TBL_CMDID);
-
- CASE_RETURN_STRING(WMI_SCAN_UPDATE_REQUEST_CMDID);
-
-
- CASE_RETURN_STRING(WMI_PDEV_SET_REGDOMAIN_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_CHANNEL_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_PARAM_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_PKTLOG_ENABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_PKTLOG_DISABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_WMM_PARAMS_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_HT_CAP_IE_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_VHT_CAP_IE_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_DSCP_TID_MAP_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_QUIET_MODE_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_GET_TPC_CONFIG_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SET_BASE_MACADDR_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_DUMP_CMDID);
-
-
- CASE_RETURN_STRING(WMI_VDEV_CREATE_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_DELETE_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_START_REQUEST_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_RESTART_REQUEST_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_UP_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_STOP_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_DOWN_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_SET_PARAM_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_INSTALL_KEY_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_WNM_SLEEPMODE_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_WMM_ADDTS_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_WMM_DELTS_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_SET_WMM_PARAMS_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_SET_GTX_PARAMS_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_IPSEC_NATKEEPALIVE_FILTER_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_PLMREQ_START_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_PLMREQ_STOP_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_TSF_TSTAMP_ACTION_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_SET_IE_CMDID);
-
-
- CASE_RETURN_STRING(WMI_PEER_CREATE_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_DELETE_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_FLUSH_TIDS_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_SET_PARAM_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_ASSOC_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_ADD_WDS_ENTRY_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_REMOVE_WDS_ENTRY_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_MCAST_GROUP_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_INFO_REQ_CMDID);
-
-
- CASE_RETURN_STRING(WMI_BCN_TX_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SEND_BCN_CMDID);
-
- CASE_RETURN_STRING(WMI_BCN_TMPL_CMDID);
-
- CASE_RETURN_STRING(WMI_BCN_FILTER_RX_CMDID);
-
- CASE_RETURN_STRING(WMI_PRB_REQ_FILTER_RX_CMDID);
-
- CASE_RETURN_STRING(WMI_MGMT_TX_CMDID);
-
- CASE_RETURN_STRING(WMI_PRB_TMPL_CMDID);
-
-
- CASE_RETURN_STRING(WMI_ADDBA_CLEAR_RESP_CMDID);
-
- CASE_RETURN_STRING(WMI_ADDBA_SEND_CMDID);
- CASE_RETURN_STRING(WMI_ADDBA_STATUS_CMDID);
-
- CASE_RETURN_STRING(WMI_DELBA_SEND_CMDID);
-
- CASE_RETURN_STRING(WMI_ADDBA_SET_RESP_CMDID);
-
- CASE_RETURN_STRING(WMI_SEND_SINGLEAMSDU_CMDID);
-
-
- CASE_RETURN_STRING(WMI_STA_POWERSAVE_MODE_CMDID);
-
- CASE_RETURN_STRING(WMI_STA_POWERSAVE_PARAM_CMDID);
-
- CASE_RETURN_STRING(WMI_STA_MIMO_PS_MODE_CMDID);
-
-
- CASE_RETURN_STRING(WMI_PDEV_DFS_ENABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_DFS_DISABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_DFS_PHYERR_FILTER_ENA_CMDID);
-
- CASE_RETURN_STRING(WMI_DFS_PHYERR_FILTER_DIS_CMDID);
-
-
- CASE_RETURN_STRING(WMI_ROAM_SCAN_MODE);
-
- CASE_RETURN_STRING(WMI_ROAM_SCAN_RSSI_THRESHOLD);
-
- CASE_RETURN_STRING(WMI_ROAM_SCAN_PERIOD);
-
- CASE_RETURN_STRING(WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD);
-
- CASE_RETURN_STRING(WMI_ROAM_AP_PROFILE);
-
- CASE_RETURN_STRING(WMI_ROAM_CHAN_LIST);
-
-
- CASE_RETURN_STRING(WMI_OFL_SCAN_ADD_AP_PROFILE);
-
- CASE_RETURN_STRING(WMI_OFL_SCAN_REMOVE_AP_PROFILE);
-
- CASE_RETURN_STRING(WMI_OFL_SCAN_PERIOD);
-
-
- CASE_RETURN_STRING(WMI_P2P_DEV_SET_DEVICE_INFO);
-
- CASE_RETURN_STRING(WMI_P2P_DEV_SET_DISCOVERABILITY);
-
- CASE_RETURN_STRING(WMI_P2P_GO_SET_BEACON_IE);
-
- CASE_RETURN_STRING(WMI_P2P_GO_SET_PROBE_RESP_IE);
-
- CASE_RETURN_STRING(WMI_P2P_SET_VENDOR_IE_DATA_CMDID);
-
- CASE_RETURN_STRING(WMI_P2P_DISC_OFFLOAD_CONFIG_CMDID);
-
- CASE_RETURN_STRING(WMI_P2P_DISC_OFFLOAD_APPIE_CMDID);
-
- CASE_RETURN_STRING(WMI_P2P_DISC_OFFLOAD_PATTERN_CMDID);
-
- CASE_RETURN_STRING(WMI_P2P_SET_OPPPS_PARAM_CMDID);
-
- CASE_RETURN_STRING(WMI_AP_PS_PEER_PARAM_CMDID);
-
- CASE_RETURN_STRING(WMI_AP_PS_PEER_UAPSD_COEX_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_RATE_RETRY_SCHED_CMDID);
-
- CASE_RETURN_STRING(WMI_WLAN_PROFILE_TRIGGER_CMDID);
- CASE_RETURN_STRING(WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID);
- CASE_RETURN_STRING(WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID);
- CASE_RETURN_STRING(WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID);
- CASE_RETURN_STRING(WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_SUSPEND_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_RESUME_CMDID);
-
-
- CASE_RETURN_STRING(WMI_ADD_BCN_FILTER_CMDID);
-
- CASE_RETURN_STRING(WMI_RMV_BCN_FILTER_CMDID);
-
-
- CASE_RETURN_STRING(WMI_WOW_ADD_WAKE_PATTERN_CMDID);
-
- CASE_RETURN_STRING(WMI_WOW_DEL_WAKE_PATTERN_CMDID);
-
- CASE_RETURN_STRING(WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID);
-
- CASE_RETURN_STRING(WMI_WOW_ENABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID);
-
-
- CASE_RETURN_STRING(WMI_RTT_MEASREQ_CMDID);
-
- CASE_RETURN_STRING(WMI_RTT_TSF_CMDID);
-
-
- CASE_RETURN_STRING(WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID);
-
-
- CASE_RETURN_STRING(WMI_REQUEST_STATS_CMDID);
-
- CASE_RETURN_STRING(WMI_MCC_SCHED_TRAFFIC_STATS_CMDID);
-
- CASE_RETURN_STRING(WMI_SET_ARP_NS_OFFLOAD_CMDID);
-
- CASE_RETURN_STRING(WMI_ADD_PROACTIVE_ARP_RSP_PATTERN_CMDID);
-
- CASE_RETURN_STRING(WMI_DEL_PROACTIVE_ARP_RSP_PATTERN_CMDID);
-
- CASE_RETURN_STRING(WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID);
-
- CASE_RETURN_STRING(WMI_GTK_OFFLOAD_CMDID);
-
-
- CASE_RETURN_STRING(WMI_CSA_OFFLOAD_ENABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_CSA_OFFLOAD_CHANSWITCH_CMDID);
-
-
- CASE_RETURN_STRING(WMI_CHATTER_SET_MODE_CMDID);
-
- CASE_RETURN_STRING(WMI_CHATTER_ADD_COALESCING_FILTER_CMDID);
-
- CASE_RETURN_STRING(WMI_CHATTER_DELETE_COALESCING_FILTER_CMDID);
-
- CASE_RETURN_STRING(WMI_CHATTER_COALESCING_QUERY_CMDID);
-
-
- CASE_RETURN_STRING(WMI_PEER_TID_ADDBA_CMDID);
-
- CASE_RETURN_STRING(WMI_PEER_TID_DELBA_CMDID);
-
- CASE_RETURN_STRING(WMI_STA_DTIM_PS_METHOD_CMDID);
-
- CASE_RETURN_STRING(WMI_STA_UAPSD_AUTO_TRIG_CMDID);
-
- CASE_RETURN_STRING(WMI_STA_KEEPALIVE_CMDID);
-
- CASE_RETURN_STRING(WMI_BA_REQ_SSN_CMDID);
-
-
- CASE_RETURN_STRING(WMI_ECHO_CMDID);
-
-
- CASE_RETURN_STRING(WMI_PDEV_UTF_CMDID);
-
- CASE_RETURN_STRING(WMI_DBGLOG_CFG_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_QVIT_CMDID);
-
- CASE_RETURN_STRING(WMI_PDEV_FTM_INTG_CMDID);
-
- CASE_RETURN_STRING(WMI_VDEV_SET_KEEPALIVE_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_GET_KEEPALIVE_CMDID);
-
- CASE_RETURN_STRING(WMI_FORCE_FW_HANG_CMDID);
-
- CASE_RETURN_STRING(WMI_SET_MCASTBCAST_FILTER_CMDID);
-
- CASE_RETURN_STRING(WMI_THERMAL_MGMT_CMDID);
- CASE_RETURN_STRING(WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_LRO_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_TRANSFER_DATA_TO_FLASH_CMDID);
- CASE_RETURN_STRING(WMI_CONFIG_ENHANCED_MCAST_FILTER_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_WISA_CMDID);
- CASE_RETURN_STRING(WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_WOW_SET_ACTION_WAKE_UP_CMDID);
- CASE_RETURN_STRING(WMI_MAWC_SENSOR_REPORT_IND_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_CONFIGURE_MAWC_CMDID);
- CASE_RETURN_STRING(WMI_NLO_CONFIGURE_MAWC_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_CONFIGURE_MAWC_CMDID);
-
- CASE_RETURN_STRING(WMI_GPIO_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_GPIO_OUTPUT_CMDID);
-
- CASE_RETURN_STRING(WMI_TXBF_CMDID);
-
- CASE_RETURN_STRING(WMI_FWTEST_VDEV_MCC_SET_TBTT_MODE_CMDID);
-
- CASE_RETURN_STRING(WMI_FWTEST_P2P_SET_NOA_PARAM_CMDID);
-
-
- CASE_RETURN_STRING(WMI_TDLS_SET_STATE_CMDID);
-
- CASE_RETURN_STRING(WMI_TDLS_PEER_UPDATE_CMDID);
-
-
- CASE_RETURN_STRING
- (WMI_RESMGR_ADAPTIVE_OCS_ENABLE_DISABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_RESMGR_SET_CHAN_TIME_QUOTA_CMDID);
-
- CASE_RETURN_STRING(WMI_RESMGR_SET_CHAN_LATENCY_CMDID);
-
-
- CASE_RETURN_STRING(WMI_STA_SMPS_FORCE_MODE_CMDID);
-
- CASE_RETURN_STRING(WMI_STA_SMPS_PARAM_CMDID);
-
-
- CASE_RETURN_STRING(WMI_HB_SET_ENABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_HB_SET_TCP_PARAMS_CMDID);
-
- CASE_RETURN_STRING(WMI_HB_SET_TCP_PKT_FILTER_CMDID);
-
- CASE_RETURN_STRING(WMI_HB_SET_UDP_PARAMS_CMDID);
-
- CASE_RETURN_STRING(WMI_HB_SET_UDP_PKT_FILTER_CMDID);
-
-
- CASE_RETURN_STRING(WMI_RMC_SET_MODE_CMDID);
-
- CASE_RETURN_STRING(WMI_RMC_SET_ACTION_PERIOD_CMDID);
-
- CASE_RETURN_STRING(WMI_RMC_CONFIG_CMDID);
-
-
- CASE_RETURN_STRING(WMI_MHF_OFFLOAD_SET_MODE_CMDID);
-
- CASE_RETURN_STRING(WMI_MHF_OFFLOAD_PLUMB_ROUTING_TBL_CMDID);
-
-
- CASE_RETURN_STRING(WMI_BATCH_SCAN_ENABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_BATCH_SCAN_DISABLE_CMDID);
-
- CASE_RETURN_STRING(WMI_BATCH_SCAN_TRIGGER_RESULT_CMDID);
-
- CASE_RETURN_STRING(WMI_OEM_REQ_CMDID);
- CASE_RETURN_STRING(WMI_OEM_REQUEST_CMDID);
-
- CASE_RETURN_STRING(WMI_NAN_CMDID);
-
- CASE_RETURN_STRING(WMI_MODEM_POWER_STATE_CMDID);
- CASE_RETURN_STRING(WMI_REQUEST_STATS_EXT_CMDID);
- CASE_RETURN_STRING(WMI_OBSS_SCAN_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_OBSS_SCAN_DISABLE_CMDID);
- CASE_RETURN_STRING(WMI_PEER_GET_ESTIMATED_LINKSPEED_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_SCAN_CMD);
- CASE_RETURN_STRING(WMI_PDEV_SET_LED_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID);
- CASE_RETURN_STRING(WMI_CHAN_AVOID_UPDATE_CMDID);
- CASE_RETURN_STRING(WMI_COEX_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_WOW_IOAC_ADD_KEEPALIVE_CMDID);
- CASE_RETURN_STRING(WMI_WOW_IOAC_DEL_KEEPALIVE_CMDID);
- CASE_RETURN_STRING(WMI_WOW_IOAC_ADD_WAKE_PATTERN_CMDID);
- CASE_RETURN_STRING(WMI_WOW_IOAC_DEL_WAKE_PATTERN_CMDID);
- CASE_RETURN_STRING(WMI_REQUEST_LINK_STATS_CMDID);
- CASE_RETURN_STRING(WMI_START_LINK_STATS_CMDID);
- CASE_RETURN_STRING(WMI_CLEAR_LINK_STATS_CMDID);
- CASE_RETURN_STRING(WMI_GET_FW_MEM_DUMP_CMDID);
- CASE_RETURN_STRING(WMI_LPI_MGMT_SNOOPING_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_LPI_START_SCAN_CMDID);
- CASE_RETURN_STRING(WMI_LPI_STOP_SCAN_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_START_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_STOP_CMDID);
- CASE_RETURN_STRING
- (WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_GET_CACHED_RESULTS_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_GET_WLAN_CHANGE_RESULTS_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_SET_CAPABILITIES_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_GET_CAPABILITIES_CMDID);
- CASE_RETURN_STRING(WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_SYNCH_COMPLETE);
- CASE_RETURN_STRING(WMI_D0_WOW_ENABLE_DISABLE_CMDID);
- CASE_RETURN_STRING(WMI_EXTWOW_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_EXTWOW_SET_APP_TYPE1_PARAMS_CMDID);
- CASE_RETURN_STRING(WMI_EXTWOW_SET_APP_TYPE2_PARAMS_CMDID);
- CASE_RETURN_STRING(WMI_UNIT_TEST_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_SET_RIC_REQUEST_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_GET_TEMPERATURE_CMDID);
- CASE_RETURN_STRING(WMI_SET_DHCP_SERVER_OFFLOAD_CMDID);
- CASE_RETURN_STRING(WMI_TPC_CHAINMASK_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_IPA_OFFLOAD_ENABLE_DISABLE_CMDID);
- CASE_RETURN_STRING(WMI_SCAN_PROB_REQ_OUI_CMDID);
- CASE_RETURN_STRING(WMI_TDLS_SET_OFFCHAN_MODE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_LED_FLASHING_CMDID);
- CASE_RETURN_STRING(WMI_MDNS_OFFLOAD_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_MDNS_SET_FQDN_CMDID);
- CASE_RETURN_STRING(WMI_MDNS_SET_RESPONSE_CMDID);
- CASE_RETURN_STRING(WMI_MDNS_GET_STATS_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_INVOKE_CMDID);
- CASE_RETURN_STRING(WMI_SET_ANTENNA_DIVERSITY_CMDID);
- CASE_RETURN_STRING(WMI_SAP_OFL_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_APFIND_CMDID);
- CASE_RETURN_STRING(WMI_PASSPOINT_LIST_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_OCB_SET_SCHED_CMDID);
- CASE_RETURN_STRING(WMI_OCB_SET_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_OCB_SET_UTC_TIME_CMDID);
- CASE_RETURN_STRING(WMI_OCB_START_TIMING_ADVERT_CMDID);
- CASE_RETURN_STRING(WMI_OCB_STOP_TIMING_ADVERT_CMDID);
- CASE_RETURN_STRING(WMI_OCB_GET_TSF_TIMER_CMDID);
- CASE_RETURN_STRING(WMI_DCC_GET_STATS_CMDID);
- CASE_RETURN_STRING(WMI_DCC_CLEAR_STATS_CMDID);
- CASE_RETURN_STRING(WMI_DCC_UPDATE_NDL_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_FILTER_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_DEBUG_MESG_FLUSH_CMDID);
- CASE_RETURN_STRING(WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID);
- CASE_RETURN_STRING(WMI_SOC_SET_PCL_CMDID);
- CASE_RETURN_STRING(WMI_SOC_SET_HW_MODE_CMDID);
- CASE_RETURN_STRING(WMI_SOC_SET_DUAL_MAC_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_WOW_ENABLE_ICMPV6_NA_FLT_CMDID);
- CASE_RETURN_STRING(WMI_DIAG_EVENT_LOG_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_PACKET_FILTER_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_PACKET_FILTER_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_SAP_SET_BLACKLIST_PARAM_CMDID);
- CASE_RETURN_STRING(WMI_WOW_UDP_SVC_OFLD_CMDID);
- CASE_RETURN_STRING(WMI_MGMT_TX_SEND_CMDID);
- CASE_RETURN_STRING(WMI_SOC_SET_ANTENNA_MODE_CMDID);
- CASE_RETURN_STRING(WMI_WOW_HOSTWAKEUP_GPIO_PIN_PATTERN_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_AP_PS_EGAP_PARAM_CMDID);
- CASE_RETURN_STRING(WMI_PMF_OFFLOAD_SET_SA_QUERY_CMDID);
- CASE_RETURN_STRING(WMI_BPF_GET_CAPABILITY_CMDID);
- CASE_RETURN_STRING(WMI_BPF_GET_VDEV_STATS_CMDID);
- CASE_RETURN_STRING(WMI_BPF_SET_VDEV_INSTRUCTIONS_CMDID);
- CASE_RETURN_STRING(WMI_BPF_DEL_VDEV_INSTRUCTIONS_CMDID);
- CASE_RETURN_STRING(WMI_NDI_GET_CAP_REQ_CMDID);
- CASE_RETURN_STRING(WMI_NDP_INITIATOR_REQ_CMDID);
- CASE_RETURN_STRING(WMI_NDP_RESPONDER_REQ_CMDID);
- CASE_RETURN_STRING(WMI_NDP_END_REQ_CMDID);
- CASE_RETURN_STRING(WMI_PEER_UPDATE_WDS_ENTRY_CMDID);
- CASE_RETURN_STRING(WMI_PEER_ADD_PROXY_STA_ENTRY_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_FIPS_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SMART_ANT_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_CTL_TABLE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_MIMOGAIN_TABLE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_GET_TPC_CMDID);
- CASE_RETURN_STRING(WMI_MIB_STATS_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_GET_ANI_CCK_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_GET_ANI_OFDM_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_RATEMASK_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_ATF_REQUEST_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_SET_DSCP_TID_MAP_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_SET_QUIET_MODE_CMDID);
- CASE_RETURN_STRING(WMI_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID);
- CASE_RETURN_STRING(WMI_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID);
- CASE_RETURN_STRING(WMI_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID);
- CASE_RETURN_STRING(WMI_PEER_ATF_REQUEST_CMDID);
- CASE_RETURN_STRING(WMI_FWTEST_CMDID);
- CASE_RETURN_STRING(WMI_QBOOST_CFG_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_GET_NFCAL_POWER_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_PCL_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_HW_MODE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_MAC_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_ANTENNA_MODE_CMDID);
- CASE_RETURN_STRING(WMI_ROAM_SET_MBO_PARAM_CMDID);
- CASE_RETURN_STRING(WMI_CHAN_AVOID_RPT_ALLOW_CMDID);
- CASE_RETURN_STRING(WMI_SET_PERIODIC_CHANNEL_STATS_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_WAL_POWER_DEBUG_CMDID);
- CASE_RETURN_STRING(WMI_PEER_BWF_REQUEST_CMDID);
- CASE_RETURN_STRING(WMI_DBGLOG_TIME_STAMP_SYNC_CMDID);
- CASE_RETURN_STRING(WMI_P2P_LISTEN_OFFLOAD_START_CMDID);
- CASE_RETURN_STRING(WMI_P2P_LISTEN_OFFLOAD_STOP_CMDID);
- CASE_RETURN_STRING(WMI_PEER_REORDER_QUEUE_SETUP_CMDID);
- CASE_RETURN_STRING(WMI_PEER_REORDER_QUEUE_REMOVE_CMDID);
- CASE_RETURN_STRING(WMI_SET_MULTIPLE_MCAST_FILTER_CMDID);
- CASE_RETURN_STRING(WMI_READ_DATA_FROM_FLASH_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_REORDER_TIMEOUT_VAL_CMDID);
- CASE_RETURN_STRING(WMI_PEER_SET_RX_BLOCKSIZE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_WAKEUP_CONFIG_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_GET_ANTDIV_STATUS_CMDID);
- CASE_RETURN_STRING(WMI_PEER_ANTDIV_INFO_REQ_CMDID);
- CASE_RETURN_STRING(WMI_MNT_FILTER_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_GET_CHIP_POWER_STATS_CMDID);
- CASE_RETURN_STRING(WMI_COEX_GET_ANTENNA_ISOLATION_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_SET_STATS_THRESHOLD_CMDID);
- CASE_RETURN_STRING(WMI_REQUEST_WLAN_STATS_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_DFS_PHYERR_OFFLOAD_ENABLE_CMDID);
- CASE_RETURN_STRING(WMI_PDEV_DFS_PHYERR_OFFLOAD_DISABLE_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_ADFS_CH_CFG_CMDID);
- CASE_RETURN_STRING(WMI_VDEV_ADFS_OCAC_ABORT_CMDID);
- }
- return "Invalid WMI cmd";
- }
- static inline void wma_log_cmd_id(uint32_t cmd_id, uint32_t tag)
- {
- WMI_LOGD("Send WMI command:%s command_id:%d htc_tag:%d\n",
- wmi_id_to_name(cmd_id), cmd_id, tag);
- }
- #else
- static uint8_t *wmi_id_to_name(uint32_t wmi_command)
- {
- return "Invalid WMI cmd";
- }
- #endif
- #ifdef CONFIG_MCL
- static bool wmi_is_runtime_pm_cmd(uint32_t cmd_id)
- {
- switch (cmd_id) {
- case WMI_WOW_ENABLE_CMDID:
- case WMI_PDEV_SUSPEND_CMDID:
- case WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID:
- case WMI_WOW_ADD_WAKE_PATTERN_CMDID:
- case WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID:
- case WMI_PDEV_RESUME_CMDID:
- case WMI_WOW_DEL_WAKE_PATTERN_CMDID:
- case WMI_D0_WOW_ENABLE_DISABLE_CMDID:
- return true;
- default:
- return false;
- }
- }
- static bool wmi_is_pm_resume_cmd(uint32_t cmd_id)
- {
- switch (cmd_id) {
- case WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID:
- case WMI_PDEV_RESUME_CMDID:
- return true;
- default:
- return false;
- }
- }
- #else
- static bool wmi_is_runtime_pm_cmd(uint32_t cmd_id)
- {
- return false;
- }
- static bool wmi_is_pm_resume_cmd(uint32_t cmd_id)
- {
- return false;
- }
- #endif
- QDF_STATUS wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf,
- uint32_t len, uint32_t cmd_id)
- {
- HTC_PACKET *pkt;
- A_STATUS status;
- uint16_t htc_tag = 0;
- if (wmi_get_runtime_pm_inprogress(wmi_handle)) {
- if (wmi_is_runtime_pm_cmd(cmd_id))
- htc_tag = HTC_TX_PACKET_TAG_AUTO_PM;
- } else if (qdf_atomic_read(&wmi_handle->is_target_suspended) &&
- (!wmi_is_pm_resume_cmd(cmd_id))) {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "%s: Target is suspended", __func__);
- QDF_ASSERT(0);
- return QDF_STATUS_E_BUSY;
- }
- if (wmi_handle->wmi_stopinprogress) {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "WMI stop in progress\n");
- return QDF_STATUS_E_INVAL;
- }
- #ifndef WMI_NON_TLV_SUPPORT
-
- if (wmi_handle->target_type == WMI_TLV_TARGET) {
- void *buf_ptr = (void *)qdf_nbuf_data(buf);
- if (wmitlv_check_command_tlv_params(NULL, buf_ptr, len, cmd_id)
- != 0) {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "\nERROR: %s: Invalid WMI Param Buffer for Cmd:%d",
- __func__, cmd_id);
- return QDF_STATUS_E_INVAL;
- }
- }
- #endif
- if (qdf_nbuf_push_head(buf, sizeof(WMI_CMD_HDR)) == NULL) {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "%s, Failed to send cmd %x, no memory",
- __func__, cmd_id);
- return QDF_STATUS_E_NOMEM;
- }
- WMI_SET_FIELD(qdf_nbuf_data(buf), WMI_CMD_HDR, COMMANDID, cmd_id);
- qdf_atomic_inc(&wmi_handle->pending_cmds);
- if (qdf_atomic_read(&wmi_handle->pending_cmds) >= WMI_MAX_CMDS) {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "\n%s: hostcredits = %d", __func__,
- wmi_get_host_credits(wmi_handle));
- htc_dump_counter_info(wmi_handle->htc_handle);
- qdf_atomic_dec(&wmi_handle->pending_cmds);
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "%s: MAX %d WMI Pending cmds reached.", __func__,
- WMI_MAX_CMDS);
- QDF_BUG(0);
- return QDF_STATUS_E_BUSY;
- }
- pkt = qdf_mem_malloc(sizeof(*pkt));
- if (!pkt) {
- qdf_atomic_dec(&wmi_handle->pending_cmds);
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "%s, Failed to alloc htc packet %x, no memory",
- __func__, cmd_id);
- return QDF_STATUS_E_NOMEM;
- }
- SET_HTC_PACKET_INFO_TX(pkt,
- NULL,
- qdf_nbuf_data(buf), len + sizeof(WMI_CMD_HDR),
- wmi_handle->wmi_endpoint_id, htc_tag);
- SET_HTC_PACKET_NET_BUF_CONTEXT(pkt, buf);
- #ifdef CONFIG_MCL
- wma_log_cmd_id(cmd_id, htc_tag);
- #endif
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- if (wmi_handle->log_info.wmi_logging_enable) {
- qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
-
- if (wmi_handle->log_info.is_management_record(cmd_id)) {
- WMI_MGMT_COMMAND_RECORD(wmi_handle, cmd_id,
- ((uint32_t *) qdf_nbuf_data(buf) +
- wmi_handle->log_info.buf_offset_command));
- } else {
- WMI_COMMAND_RECORD(wmi_handle, cmd_id,
- ((uint32_t *) qdf_nbuf_data(buf) +
- wmi_handle->log_info.buf_offset_command));
- }
- qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
- }
- #endif
- status = htc_send_pkt(wmi_handle->htc_handle, pkt);
- if (A_OK != status) {
- qdf_atomic_dec(&wmi_handle->pending_cmds);
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "%s %d, htc_send_pkt failed", __func__, __LINE__);
- qdf_mem_free(pkt);
- }
- if (status)
- return QDF_STATUS_E_FAILURE;
- return QDF_STATUS_SUCCESS;
- }
- static int wmi_unified_get_event_handler_ix(wmi_unified_t wmi_handle,
- uint32_t event_id)
- {
- uint32_t idx = 0;
- int32_t invalid_idx = -1;
- for (idx = 0; (idx < wmi_handle->max_event_idx &&
- idx < WMI_UNIFIED_MAX_EVENT); ++idx) {
- if (wmi_handle->event_id[idx] == event_id &&
- wmi_handle->event_handler[idx] != NULL) {
- return idx;
- }
- }
- return invalid_idx;
- }
- int wmi_unified_register_event_handler(wmi_unified_t wmi_handle,
- uint32_t event_id,
- wmi_unified_event_handler handler_func,
- uint8_t rx_ctx)
- {
- uint32_t idx = 0;
- uint32_t evt_id;
- #ifndef CONFIG_MCL
- if (event_id >= wmi_events_max ||
- wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) {
- qdf_print("%s: Event id %d is unavailable\n",
- __func__, event_id);
- return QDF_STATUS_E_FAILURE;
- }
- evt_id = wmi_handle->wmi_events[event_id];
- #else
- evt_id = event_id;
- #endif
- if (wmi_unified_get_event_handler_ix(wmi_handle, evt_id) != -1) {
- qdf_print("%s : event handler already registered 0x%x\n",
- __func__, evt_id);
- return QDF_STATUS_E_FAILURE;
- }
- if (wmi_handle->max_event_idx == WMI_UNIFIED_MAX_EVENT) {
- qdf_print("%s : no more event handlers 0x%x\n",
- __func__, evt_id);
- return QDF_STATUS_E_FAILURE;
- }
- idx = wmi_handle->max_event_idx;
- wmi_handle->event_handler[idx] = handler_func;
- wmi_handle->event_id[idx] = evt_id;
- qdf_spin_lock_bh(&wmi_handle->ctx_lock);
- wmi_handle->ctx[idx] = rx_ctx;
- qdf_spin_unlock_bh(&wmi_handle->ctx_lock);
- wmi_handle->max_event_idx++;
- return 0;
- }
- int wmi_unified_unregister_event_handler(wmi_unified_t wmi_handle,
- uint32_t event_id)
- {
- uint32_t idx = 0;
- uint32_t evt_id;
- #ifndef CONFIG_MCL
- if (event_id >= wmi_events_max ||
- wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) {
- qdf_print("%s: Event id %d is unavailable\n",
- __func__, event_id);
- return QDF_STATUS_E_FAILURE;
- }
- evt_id = wmi_handle->wmi_events[event_id];
- #else
- evt_id = event_id;
- #endif
- idx = wmi_unified_get_event_handler_ix(wmi_handle, evt_id);
- if (idx == -1) {
- qdf_print("%s : event handler is not registered: evt id 0x%x\n",
- __func__, evt_id);
- return QDF_STATUS_E_FAILURE;
- }
- wmi_handle->event_handler[idx] = NULL;
- wmi_handle->event_id[idx] = 0;
- --wmi_handle->max_event_idx;
- wmi_handle->event_handler[idx] =
- wmi_handle->event_handler[wmi_handle->max_event_idx];
- wmi_handle->event_id[idx] =
- wmi_handle->event_id[wmi_handle->max_event_idx];
- return 0;
- }
- static void wmi_process_fw_event_default_ctx(struct wmi_unified *wmi_handle,
- HTC_PACKET *htc_packet, uint8_t exec_ctx)
- {
- wmi_buf_t evt_buf;
- evt_buf = (wmi_buf_t) htc_packet->pPktContext;
- #ifndef CONFIG_MCL
- wmi_handle->rx_ops.wma_process_fw_event_handler_cbk
- (wmi_handle->scn_handle, evt_buf, exec_ctx);
- #else
- wmi_handle->rx_ops.wma_process_fw_event_handler_cbk(wmi_handle,
- evt_buf, exec_ctx);
- #endif
- return;
- }
- static void wmi_process_fw_event_worker_thread_ctx
- (struct wmi_unified *wmi_handle, HTC_PACKET *htc_packet)
- {
- wmi_buf_t evt_buf;
- uint32_t id;
- uint8_t *data;
- evt_buf = (wmi_buf_t) htc_packet->pPktContext;
- id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID);
- data = qdf_nbuf_data(evt_buf);
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- if (wmi_handle->log_info.wmi_logging_enable) {
- qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
-
- WMI_RX_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data +
- wmi_handle->log_info.buf_offset_event));
- qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
- }
- #endif
- qdf_spin_lock_bh(&wmi_handle->eventq_lock);
- qdf_nbuf_queue_add(&wmi_handle->event_queue, evt_buf);
- qdf_spin_unlock_bh(&wmi_handle->eventq_lock);
- schedule_work(&wmi_handle->rx_event_work);
- return;
- }
- static void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet)
- {
- struct wmi_unified *wmi_handle = (struct wmi_unified *)ctx;
- wmi_buf_t evt_buf;
- uint32_t id;
- uint32_t idx = 0;
- enum wmi_rx_exec_ctx exec_ctx;
- evt_buf = (wmi_buf_t) htc_packet->pPktContext;
- id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID);
- idx = wmi_unified_get_event_handler_ix(wmi_handle, id);
- if (qdf_unlikely(idx == A_ERROR)) {
- qdf_print
- ("%s :event handler is not registered: event id 0x%x\n",
- __func__, id);
- qdf_nbuf_free(evt_buf);
- return;
- }
- qdf_spin_lock_bh(&wmi_handle->ctx_lock);
- exec_ctx = wmi_handle->ctx[idx];
- qdf_spin_unlock_bh(&wmi_handle->ctx_lock);
- if (exec_ctx == WMI_RX_WORK_CTX) {
- wmi_process_fw_event_worker_thread_ctx
- (wmi_handle, htc_packet);
- } else if (exec_ctx > WMI_RX_WORK_CTX) {
- wmi_process_fw_event_default_ctx
- (wmi_handle, htc_packet, exec_ctx);
- } else {
- qdf_print("%s :Invalid event context %d\n", __func__, exec_ctx);
- qdf_nbuf_free(evt_buf);
- }
- }
- void wmi_process_fw_event(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf)
- {
- __wmi_control_rx(wmi_handle, evt_buf);
- }
- void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf)
- {
- uint32_t id;
- uint8_t *data;
- uint32_t len;
- void *wmi_cmd_struct_ptr = NULL;
- #ifndef WMI_NON_TLV_SUPPORT
- int tlv_ok_status = 0;
- #endif
- uint32_t idx = 0;
- id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID);
- if (qdf_nbuf_pull_head(evt_buf, sizeof(WMI_CMD_HDR)) == NULL)
- goto end;
- data = qdf_nbuf_data(evt_buf);
- len = qdf_nbuf_len(evt_buf);
- #ifndef WMI_NON_TLV_SUPPORT
- if (wmi_handle->target_type == WMI_TLV_TARGET) {
-
- tlv_ok_status =
- wmitlv_check_and_pad_event_tlvs(wmi_handle->scn_handle,
- data, len, id,
- &wmi_cmd_struct_ptr);
- if (tlv_ok_status != 0) {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "%s: Error: id=0x%d, wmitlv check status=%d\n",
- __func__, id, tlv_ok_status);
- goto end;
- }
- }
- #endif
- idx = wmi_unified_get_event_handler_ix(wmi_handle, id);
- if (idx == A_ERROR) {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
- "%s : event handler is not registered: event id 0x%x\n",
- __func__, id);
- goto end;
- }
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- if (wmi_handle->log_info.wmi_logging_enable) {
- qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
-
- if (wmi_handle->log_info.is_management_record(id)) {
- WMI_MGMT_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data
- + wmi_handle->log_info.buf_offset_event));
- } else {
- WMI_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data +
- wmi_handle->log_info.buf_offset_event));
- }
- qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
- }
- #endif
-
- if (wmi_handle->target_type == WMI_TLV_TARGET)
- wmi_handle->event_handler[idx] (wmi_handle->scn_handle,
- wmi_cmd_struct_ptr, len);
- else
- wmi_handle->event_handler[idx] (wmi_handle->scn_handle,
- data, len);
- end:
-
- #ifndef WMI_NON_TLV_SUPPORT
- if (wmi_handle->target_type == WMI_TLV_TARGET)
- wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr);
- #endif
- qdf_nbuf_free(evt_buf);
- }
- static void wmi_rx_event_work(struct work_struct *work)
- {
- struct wmi_unified *wmi = container_of(work, struct wmi_unified,
- rx_event_work);
- wmi_buf_t buf;
- qdf_spin_lock_bh(&wmi->eventq_lock);
- buf = qdf_nbuf_queue_remove(&wmi->event_queue);
- qdf_spin_unlock_bh(&wmi->eventq_lock);
- while (buf) {
- __wmi_control_rx(wmi, buf);
- qdf_spin_lock_bh(&wmi->eventq_lock);
- buf = qdf_nbuf_queue_remove(&wmi->event_queue);
- qdf_spin_unlock_bh(&wmi->eventq_lock);
- }
- }
- #ifdef FEATURE_RUNTIME_PM
- static void wmi_runtime_pm_init(struct wmi_unified *wmi_handle)
- {
- qdf_atomic_init(&wmi_handle->runtime_pm_inprogress);
- }
- void wmi_set_runtime_pm_inprogress(wmi_unified_t wmi_handle, A_BOOL val)
- {
- qdf_atomic_set(&wmi_handle->runtime_pm_inprogress, val);
- }
- inline bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle)
- {
- return qdf_atomic_read(&wmi_handle->runtime_pm_inprogress);
- }
- #else
- static void wmi_runtime_pm_init(struct wmi_unified *wmi_handle)
- {
- }
- #endif
- void *wmi_unified_attach(void *scn_handle,
- osdev_t osdev, enum wmi_target_type target_type,
- bool use_cookie, struct wmi_rx_ops *rx_ops)
- {
- struct wmi_unified *wmi_handle;
- #ifdef CONFIG_MCL
- wmi_handle =
- (struct wmi_unified *)os_malloc(NULL,
- sizeof(struct wmi_unified),
- GFP_ATOMIC);
- #else
- wmi_handle =
- (struct wmi_unified *) qdf_mem_malloc(
- sizeof(struct wmi_unified));
- #endif
- if (wmi_handle == NULL) {
- qdf_print("allocation of wmi handle failed %zu\n",
- sizeof(struct wmi_unified));
- return NULL;
- }
- OS_MEMZERO(wmi_handle, sizeof(struct wmi_unified));
- wmi_handle->scn_handle = scn_handle;
- qdf_atomic_init(&wmi_handle->pending_cmds);
- qdf_atomic_init(&wmi_handle->is_target_suspended);
- wmi_runtime_pm_init(wmi_handle);
- qdf_spinlock_create(&wmi_handle->eventq_lock);
- qdf_nbuf_queue_init(&wmi_handle->event_queue);
- INIT_WORK(&wmi_handle->rx_event_work, wmi_rx_event_work);
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- if (QDF_STATUS_SUCCESS == wmi_log_init(wmi_handle)) {
- qdf_spinlock_create(&wmi_handle->log_info.wmi_record_lock);
- wmi_debugfs_init(wmi_handle);
- }
- #endif
-
- wmi_handle->rx_ops.wma_process_fw_event_handler_cbk =
- rx_ops->wma_process_fw_event_handler_cbk;
- wmi_handle->target_type = target_type;
- if (target_type == WMI_TLV_TARGET)
- wmi_tlv_attach(wmi_handle);
- else
- wmi_non_tlv_attach(wmi_handle);
-
- wmi_handle->use_cookie = use_cookie;
- wmi_handle->osdev = osdev;
- wmi_handle->wmi_stopinprogress = 0;
- qdf_spinlock_create(&wmi_handle->ctx_lock);
- return wmi_handle;
- }
- void wmi_unified_detach(struct wmi_unified *wmi_handle)
- {
- wmi_buf_t buf;
- cancel_work_sync(&wmi_handle->rx_event_work);
- wmi_debugfs_remove(wmi_handle);
- buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
- while (buf) {
- qdf_nbuf_free(buf);
- buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
- }
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- wmi_log_buffer_free(wmi_handle);
- #endif
- qdf_spinlock_destroy(&wmi_handle->eventq_lock);
- qdf_spinlock_destroy(&wmi_handle->ctx_lock);
- OS_FREE(wmi_handle);
- wmi_handle = NULL;
- }
- void
- wmi_unified_remove_work(struct wmi_unified *wmi_handle)
- {
- wmi_buf_t buf;
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO,
- "Enter: %s", __func__);
- cancel_work_sync(&wmi_handle->rx_event_work);
- qdf_spin_lock_bh(&wmi_handle->eventq_lock);
- buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
- while (buf) {
- qdf_nbuf_free(buf);
- buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
- }
- qdf_spin_unlock_bh(&wmi_handle->eventq_lock);
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO,
- "Done: %s", __func__);
- }
- static void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
- {
- struct wmi_unified *wmi_handle = (struct wmi_unified *)ctx;
- wmi_buf_t wmi_cmd_buf = GET_HTC_PACKET_NET_BUF_CONTEXT(htc_pkt);
- u_int8_t *buf_ptr;
- u_int32_t len;
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- uint32_t cmd_id;
- #endif
- ASSERT(wmi_cmd_buf);
- #ifdef WMI_INTERFACE_EVENT_LOGGING
- if (wmi_handle->log_info.wmi_logging_enable) {
- cmd_id = WMI_GET_FIELD(qdf_nbuf_data(wmi_cmd_buf),
- WMI_CMD_HDR, COMMANDID);
- qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
-
- if (wmi_handle->log_info.is_management_record(cmd_id)) {
- WMI_MGMT_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id,
- ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) +
- wmi_handle->log_info.buf_offset_command));
- } else {
- WMI_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id,
- ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) +
- wmi_handle->log_info.buf_offset_command));
- }
- qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
- }
- #endif
- buf_ptr = (u_int8_t *) wmi_buf_data(wmi_cmd_buf);
- len = qdf_nbuf_len(wmi_cmd_buf);
- qdf_mem_zero(buf_ptr, len);
- qdf_nbuf_free(wmi_cmd_buf);
- qdf_mem_free(htc_pkt);
- qdf_atomic_dec(&wmi_handle->pending_cmds);
- }
- int
- wmi_unified_connect_htc_service(struct wmi_unified *wmi_handle,
- void *htc_handle)
- {
- int status;
- HTC_SERVICE_CONNECT_RESP response;
- HTC_SERVICE_CONNECT_REQ connect;
- OS_MEMZERO(&connect, sizeof(connect));
- OS_MEMZERO(&response, sizeof(response));
-
- connect.pMetaData = NULL;
- connect.MetaDataLength = 0;
-
- connect.EpCallbacks.pContext = wmi_handle;
- connect.EpCallbacks.EpTxCompleteMultiple =
- NULL ;
- connect.EpCallbacks.EpRecv = wmi_control_rx ;
- connect.EpCallbacks.EpRecvRefill = NULL ;
- connect.EpCallbacks.EpSendFull = NULL ;
- connect.EpCallbacks.EpTxComplete =
- wmi_htc_tx_complete ;
-
- connect.service_id = WMI_CONTROL_SVC;
- status = htc_connect_service(htc_handle, &connect,
- &response);
- if (status != EOK) {
- qdf_print
- ("Failed to connect to WMI CONTROL service status:%d \n",
- status);
- return status;
- }
- wmi_handle->wmi_endpoint_id = response.Endpoint;
- wmi_handle->htc_handle = htc_handle;
- wmi_handle->max_msg_len = response.MaxMsgLength;
- return EOK;
- }
- int wmi_get_host_credits(wmi_unified_t wmi_handle)
- {
- int host_credits = 0;
- htc_get_control_endpoint_tx_host_credits(wmi_handle->htc_handle,
- &host_credits);
- return host_credits;
- }
- int wmi_get_pending_cmds(wmi_unified_t wmi_handle)
- {
- return qdf_atomic_read(&wmi_handle->pending_cmds);
- }
- void wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val)
- {
- qdf_atomic_set(&wmi_handle->is_target_suspended, val);
- }
- #ifndef CONFIG_MCL
- void
- wmi_flush_endpoint(wmi_unified_t wmi_handle)
- {
- htc_flush_endpoint(wmi_handle->htc_handle,
- wmi_handle->wmi_endpoint_id, 0);
- }
- int
- wmi_stop(wmi_unified_t wmi_handle)
- {
- QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO,
- "WMI Stop\n");
- wmi_handle->wmi_stopinprogress = 1;
- return 0;
- }
- #endif
|