debil228

Untitled

Nov 5th, 2019
831
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. static void proc_get_req(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam)
  2. {
  3. uint16_t cfgId, i;
  4. uint32_t value, valueLen, result;
  5. uint32_t *pValue;
  6.  
  7. pe_debug("Rcvd cfg get request %d bytes", length);
  8. for (i = 0; i < length / 4; i++)
  9. pe_debug("[%2d] 0x%08x", i, pParam[i]);
  10.  
  11. if (!pMac->cfg.gCfgStatus) {
  12. cfgId = (uint16_t) sir_read_u32_n((uint8_t *) pParam);
  13. pe_debug("CFG not ready, param %d", cfgId);
  14. pMac->cfg.gParamList[WNI_CFG_GET_RSP_RES] =
  15. WNI_CFG_NOT_READY;
  16. pMac->cfg.gParamList[WNI_CFG_GET_RSP_PID] = cfgId;
  17. pMac->cfg.gParamList[WNI_CFG_GET_RSP_PLEN] = 0;
  18. cfg_send_host_msg(pMac, WNI_CFG_GET_RSP,
  19. WNI_CFG_GET_RSP_PARTIAL_LEN, WNI_CFG_GET_RSP_NUM,
  20. pMac->cfg.gParamList, 0, 0);
  21. } else {
  22. /* Process all parameter ID's on the list */
  23. while (length >= sizeof(uint32_t)) {
  24. cfgId = (uint16_t) *pParam++;
  25. pValue = 0;
  26. valueLen = 0;
  27.  
  28. pe_debug("Cfg get param %d", cfgId);
  29. /* Check for valid parameter ID, etc... */
  30. if (check_param
  31. (pMac, cfgId, CFG_CTL_RE, WNI_CFG_WO_PARAM,
  32. &result)) {
  33. if ((pMac->cfg.gCfgEntry[cfgId].
  34. control & CFG_CTL_INT) != 0) {
  35. /* Get integer parameter */
  36. result =
  37. (wlan_cfg_get_int(pMac, cfgId, &value)
  38. ==
  39. eSIR_SUCCESS ? WNI_CFG_SUCCESS :
  40. WNI_CFG_OTHER_ERROR);
  41. pValue = &value;
  42. valueLen = sizeof(uint32_t);
  43. } else {
  44. /* Get string parameter */
  45. valueLen = sizeof(pMac->cfg.gSBuffer);
  46. result =
  47. (wlan_cfg_get_str
  48. (pMac, cfgId, pMac->cfg.gSBuffer,
  49. &valueLen)
  50. == eSIR_SUCCESS ? WNI_CFG_SUCCESS :
  51. WNI_CFG_OTHER_ERROR);
  52. pValue =
  53. (uint32_t *) pMac->cfg.gSBuffer;
  54. }
  55. } else {
  56. pe_warn("Check param failed, param %d",
  57. cfgId);
  58. result = WNI_CFG_INVALID_LEN;
  59. }
  60.  
  61. /* Send response message to host */
  62. pMac->cfg.gParamList[WNI_CFG_GET_RSP_RES] = result;
  63. pMac->cfg.gParamList[WNI_CFG_GET_RSP_PID] = cfgId;
  64. pMac->cfg.gParamList[WNI_CFG_GET_RSP_PLEN] = valueLen;
  65.  
  66. /* We need to round up buffer length to word-increment */
  67. valueLen = (((valueLen + 3) >> 2) << 2);
  68. cfg_send_host_msg(pMac, WNI_CFG_GET_RSP,
  69. WNI_CFG_GET_RSP_PARTIAL_LEN + valueLen,
  70. WNI_CFG_GET_RSP_NUM,
  71. pMac->cfg.gParamList, valueLen, pValue);
  72.  
  73. /* Decrement length */
  74. length -= sizeof(uint32_t);
  75. }
  76. }
  77.  
  78. } /*** end procGetReq() ***/
Advertisement
Add Comment
Please, Sign In to add comment