static int iwm_phy_db_get_section_data(struct iwm_phy_db *phy_db, uint32_t type, uint8_t **data, uint16_t *size, uint16_t ch_id) { struct iwm_phy_db_entry *entry; uint16_t ch_group_id = 0; if (!phy_db) return EINVAL; /* find wanted channel group */ if (type == IWM_PHY_DB_CALIB_CHG_PAPD) ch_group_id = channel_id_to_papd(ch_id); else if (type == IWM_PHY_DB_CALIB_CHG_TXP) ch_group_id = channel_id_to_txp(phy_db, ch_id); entry = iwm_phy_db_get_section(phy_db, type, ch_group_id); if (!entry) return EINVAL; *data = entry->data; *size = entry->size; IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET, "%s(%d): [PHYDB] GET: Type %d , Size: %d\n", __func__, __LINE__, type, *size); return 0; }
static int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db, u32 type, u8 **data, u16 *size, u16 ch_id) { struct iwl_phy_db_entry *entry; u16 ch_group_id = 0; if (!phy_db) return -EINVAL; /* find wanted channel group */ if (type == IWL_PHY_DB_CALIB_CHG_PAPD) ch_group_id = channel_id_to_papd(ch_id); else if (type == IWL_PHY_DB_CALIB_CHG_TXP) ch_group_id = channel_id_to_txp(phy_db, ch_id); entry = iwl_phy_db_get_section(phy_db, type, ch_group_id); if (!entry) return -EINVAL; *data = entry->data; *size = entry->size; IWL_DEBUG_INFO(phy_db->trans, "%s(%d): [PHYDB] GET: Type %d , Size: %d\n", __func__, __LINE__, type, *size); return 0; }
int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db, enum iwl_phy_db_section_type type, u8 **data, u16 *size, u16 ch_id) { struct iwl_phy_db_entry *entry; u32 channel_num; u32 channel_size; u16 ch_group_id = 0; u16 index; if (!phy_db) return -EINVAL; /* find wanted channel group */ if (type == IWL_PHY_DB_CALIB_CHG_PAPD) ch_group_id = channel_id_to_papd(ch_id); else if (type == IWL_PHY_DB_CALIB_CHG_TXP) ch_group_id = channel_id_to_txp(phy_db, ch_id); entry = iwl_phy_db_get_section(phy_db, type, ch_group_id); if (!entry) return -EINVAL; if (type == IWL_PHY_DB_CALIB_CH) { index = ch_id_to_ch_index(ch_id); channel_num = phy_db->channel_num; channel_size = phy_db->channel_size; if (index >= channel_num) { IWL_ERR(phy_db, "Wrong channel number %d", ch_id); return -EINVAL; } *data = entry->data + CHANNEL_NUM_SIZE + index * channel_size; *size = channel_size; } else { *data = entry->data; *size = entry->size; } return 0; }