Lines Matching defs:phy_db
227 struct iwm_phy_db *phy_db = malloc(sizeof(struct iwm_phy_db),
230 if (!phy_db)
231 return phy_db;
233 phy_db->sc = sc;
235 phy_db->n_group_txp = -1;
236 phy_db->n_group_papd = -1;
239 return phy_db;
247 iwm_phy_db_get_section(struct iwm_phy_db *phy_db,
251 if (!phy_db || type >= IWM_PHY_DB_MAX)
256 return &phy_db->cfg;
258 return &phy_db->calib_nch;
260 if (chg_id >= phy_db->n_group_papd)
262 return &phy_db->calib_ch_group_papd[chg_id];
264 if (chg_id >= phy_db->n_group_txp)
266 return &phy_db->calib_ch_group_txp[chg_id];
274 iwm_phy_db_free_section(struct iwm_phy_db *phy_db,
278 iwm_phy_db_get_section(phy_db, type, chg_id);
289 iwm_phy_db_free(struct iwm_phy_db *phy_db)
293 if (!phy_db)
296 iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CFG, 0);
297 iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_NCH, 0);
299 for (i = 0; i < phy_db->n_group_papd; i++)
300 iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_PAPD, i);
301 if (phy_db->calib_ch_group_papd != NULL)
302 free(phy_db->calib_ch_group_papd, M_DEVBUF);
304 for (i = 0; i < phy_db->n_group_txp; i++)
305 iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_TXP, i);
306 if (phy_db->calib_ch_group_txp != NULL)
307 free(phy_db->calib_ch_group_txp, M_DEVBUF);
309 free(phy_db, M_DEVBUF);
313 iwm_phy_db_set_section(struct iwm_phy_db *phy_db,
323 if (!phy_db)
328 if (phy_db && !phy_db->calib_ch_group_papd) {
333 phy_db->calib_ch_group_papd = malloc(
336 if (!phy_db->calib_ch_group_papd)
338 phy_db->n_group_papd = chg_id + 1;
342 if (phy_db && !phy_db->calib_ch_group_txp) {
347 phy_db->calib_ch_group_txp = malloc(
350 if (!phy_db->calib_ch_group_txp)
352 phy_db->n_group_txp = chg_id + 1;
356 entry = iwm_phy_db_get_section(phy_db, type, chg_id);
371 IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
421 channel_id_to_txp(struct iwm_phy_db *phy_db, uint16_t ch_id)
429 for (i = 0; i < phy_db->n_group_txp; i++) {
430 txp_chg = (void *)phy_db->calib_ch_group_txp[i].data;
444 iwm_phy_db_get_section_data(struct iwm_phy_db *phy_db,
451 if (!phy_db)
458 ch_group_id = channel_id_to_txp(phy_db, ch_id);
460 entry = iwm_phy_db_get_section(phy_db, type, ch_group_id);
467 IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
475 iwm_send_phy_db_cmd(struct iwm_phy_db *phy_db, uint16_t type,
483 IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
500 return iwm_send_cmd(phy_db->sc, &cmd);
504 iwm_phy_db_send_all_channel_groups(struct iwm_phy_db *phy_db,
514 entry = iwm_phy_db_get_section(phy_db,
524 err = iwm_send_phy_db_cmd(phy_db,
529 device_printf(phy_db->sc->sc_dev,
530 "Can't SEND phy_db section %d (%d), err %d\n",
535 IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD,
543 iwm_send_phy_db_data(struct iwm_phy_db *phy_db)
549 IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
554 err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CFG,
557 device_printf(phy_db->sc->sc_dev,
563 err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CFG, size, data);
565 device_printf(phy_db->sc->sc_dev,
571 err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CALIB_NCH,
574 device_printf(phy_db->sc->sc_dev,
580 err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CALIB_NCH, size, data);
582 device_printf(phy_db->sc->sc_dev,
589 err = iwm_phy_db_send_all_channel_groups(phy_db,
590 IWM_PHY_DB_CALIB_CHG_PAPD, phy_db->n_group_papd);
592 device_printf(phy_db->sc->sc_dev,
599 err = iwm_phy_db_send_all_channel_groups(phy_db,
600 IWM_PHY_DB_CALIB_CHG_TXP, phy_db->n_group_txp);
602 device_printf(phy_db->sc->sc_dev,
608 IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,