Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145481061
D8541.1778015397.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
19 KB
Referenced Files
None
Subscribers
None
D8541.1778015397.diff
View Options
Index: sys/dev/iwm/if_iwm.c
===================================================================
--- sys/dev/iwm/if_iwm.c
+++ sys/dev/iwm/if_iwm.c
@@ -4598,11 +4598,9 @@
goto error;
}
- /* Send phy db control command and then phy db calibration*/
- if ((error = iwm_send_phy_db_data(sc)) != 0) {
- device_printf(sc->sc_dev, "phy_db_data failed\n");
+ /* Send phy db control command and then phy db calibration */
+ if ((error = iwm_send_phy_db_data(sc->sc_phy_db)) != 0)
goto error;
- }
if ((error = iwm_send_phy_cfg_cmd(sc)) != 0) {
device_printf(sc->sc_dev, "phy_cfg_cmd failed\n");
@@ -5226,13 +5224,9 @@
wakeup(&sc->sc_uc);
break; }
- case IWM_CALIB_RES_NOTIF_PHY_DB: {
- struct iwm_calib_res_notif_phy_db *phy_db_notif;
- phy_db_notif = (void *)pkt->data;
-
- iwm_phy_db_set_section(sc, phy_db_notif);
-
- break; }
+ case IWM_CALIB_RES_NOTIF_PHY_DB:
+ iwm_phy_db_set_section(sc->sc_phy_db, pkt);
+ break;
case IWM_STATISTICS_NOTIFICATION: {
struct iwm_notif_statistics *stats;
@@ -5753,6 +5747,13 @@
callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0);
TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc);
+ /* Init phy db */
+ sc->sc_phy_db = iwm_phy_db_init(sc);
+ if (!sc->sc_phy_db) {
+ device_printf(dev, "Cannot init phy_db\n");
+ goto fail;
+ }
+
/* PCI attach */
error = iwm_pci_attach(dev);
if (error != 0)
@@ -6202,7 +6203,8 @@
ieee80211_ifdetach(&sc->sc_ic);
}
- iwm_phy_db_free(sc);
+ iwm_phy_db_free(sc->sc_phy_db);
+ sc->sc_phy_db = NULL;
/* Free descriptor rings */
iwm_free_rx_ring(sc, &sc->rxq);
Index: sys/dev/iwm/if_iwm_phy_db.h
===================================================================
--- sys/dev/iwm/if_iwm_phy_db.h
+++ sys/dev/iwm/if_iwm_phy_db.h
@@ -106,8 +106,12 @@
#ifndef __IF_IWM_PHY_DB_H__
#define __IF_IWM_PHY_DB_H__
-extern int iwm_phy_db_set_section(struct iwm_softc *sc,
- struct iwm_calib_res_notif_phy_db *phy_db_notif);
-extern int iwm_send_phy_db_data(struct iwm_softc *sc);
-extern void iwm_phy_db_free(struct iwm_softc *sc);
+struct iwm_calib_res_notif_phy_db;
+
+extern struct iwm_phy_db *iwm_phy_db_init(struct iwm_softc *sc);
+extern void iwm_phy_db_free(struct iwm_phy_db *phy_db);
+extern int iwm_phy_db_set_section(struct iwm_phy_db *phy_db,
+ struct iwm_rx_packet *pkt);
+extern int iwm_send_phy_db_data(struct iwm_phy_db *phy_db);
+
#endif /* __IF_IWM_PHY_DB_H__ */
Index: sys/dev/iwm/if_iwm_phy_db.c
===================================================================
--- sys/dev/iwm/if_iwm_phy_db.c
+++ sys/dev/iwm/if_iwm_phy_db.c
@@ -156,20 +156,98 @@
#include <dev/iwm/if_iwm_util.h>
#include <dev/iwm/if_iwm_phy_db.h>
+#define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */
+
+struct iwm_phy_db_entry {
+ uint16_t size;
+ uint8_t *data;
+};
+
+/**
+ * struct iwm_phy_db - stores phy configuration and calibration data.
+ *
+ * @cfg: phy configuration.
+ * @calib_nch: non channel specific calibration data.
+ * @calib_ch: channel specific calibration data.
+ * @n_group_papd: number of entries in papd channel group.
+ * @calib_ch_group_papd: calibration data related to papd channel group.
+ * @n_group_txp: number of entries in tx power channel group.
+ * @calib_ch_group_txp: calibration data related to tx power chanel group.
+ */
+struct iwm_phy_db {
+ struct iwm_phy_db_entry cfg;
+ struct iwm_phy_db_entry calib_nch;
+ int n_group_papd;
+ struct iwm_phy_db_entry *calib_ch_group_papd;
+ int n_group_txp;
+ struct iwm_phy_db_entry *calib_ch_group_txp;
+
+ struct iwm_softc *sc;
+};
+
+enum iwm_phy_db_section_type {
+ IWM_PHY_DB_CFG = 1,
+ IWM_PHY_DB_CALIB_NCH,
+ IWM_PHY_DB_UNUSED,
+ IWM_PHY_DB_CALIB_CHG_PAPD,
+ IWM_PHY_DB_CALIB_CHG_TXP,
+ IWM_PHY_DB_MAX
+};
+
+#define PHY_DB_CMD 0x6c
+
/*
- * BEGIN iwl-phy-db.c
+ * phy db - configure operational ucode
*/
+struct iwm_phy_db_cmd {
+ uint16_t type;
+ uint16_t length;
+ uint8_t data[];
+} __packed;
+
+/* for parsing of tx power channel group data that comes from the firmware*/
+struct iwm_phy_db_chg_txp {
+ uint32_t space;
+ uint16_t max_channel_idx;
+} __packed;
+
+/*
+ * phy db - Receive phy db chunk after calibrations
+ */
+struct iwm_calib_res_notif_phy_db {
+ uint16_t type;
+ uint16_t length;
+ uint8_t data[];
+} __packed;
+
+struct iwm_phy_db *
+iwm_phy_db_init(struct iwm_softc *sc)
+{
+ struct iwm_phy_db *phy_db = malloc(sizeof(struct iwm_phy_db),
+ M_DEVBUF, M_NOWAIT | M_ZERO);
+
+ if (!phy_db)
+ return phy_db;
+
+ phy_db->sc = sc;
+
+ phy_db->n_group_txp = -1;
+ phy_db->n_group_papd = -1;
+
+ /* TODO: add default values of the phy db. */
+ return phy_db;
+}
+
/*
* get phy db section: returns a pointer to a phy db section specified by
* type and channel group id.
*/
static struct iwm_phy_db_entry *
-iwm_phy_db_get_section(struct iwm_softc *sc,
- enum iwm_phy_db_section_type type, uint16_t chg_id)
+iwm_phy_db_get_section(struct iwm_phy_db *phy_db,
+ enum iwm_phy_db_section_type type,
+ uint16_t chg_id)
{
- struct iwm_phy_db *phy_db = &sc->sc_phy_db;
-
- if (type >= IWM_PHY_DB_MAX)
+ if (!phy_db || type >= IWM_PHY_DB_MAX)
return NULL;
switch (type) {
@@ -178,11 +256,11 @@
case IWM_PHY_DB_CALIB_NCH:
return &phy_db->calib_nch;
case IWM_PHY_DB_CALIB_CHG_PAPD:
- if (chg_id >= IWM_NUM_PAPD_CH_GROUPS)
+ if (chg_id >= phy_db->n_group_papd)
return NULL;
return &phy_db->calib_ch_group_papd[chg_id];
case IWM_PHY_DB_CALIB_CHG_TXP:
- if (chg_id >= IWM_NUM_TXP_CH_GROUPS)
+ if (chg_id >= phy_db->n_group_txp)
return NULL;
return &phy_db->calib_ch_group_txp[chg_id];
default:
@@ -191,24 +269,94 @@
return NULL;
}
+static void
+iwm_phy_db_free_section(struct iwm_phy_db *phy_db,
+ enum iwm_phy_db_section_type type, uint16_t chg_id)
+{
+ struct iwm_phy_db_entry *entry =
+ iwm_phy_db_get_section(phy_db, type, chg_id);
+ if (!entry)
+ return;
+
+ if (entry->data != NULL)
+ free(entry->data, M_DEVBUF);
+ entry->data = NULL;
+ entry->size = 0;
+}
+
+void
+iwm_phy_db_free(struct iwm_phy_db *phy_db)
+{
+ int i;
+
+ if (!phy_db)
+ return;
+
+ iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CFG, 0);
+ iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_NCH, 0);
+
+ for (i = 0; i < phy_db->n_group_papd; i++)
+ iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_PAPD, i);
+ if (phy_db->calib_ch_group_papd != NULL)
+ free(phy_db->calib_ch_group_papd, M_DEVBUF);
+
+ for (i = 0; i < phy_db->n_group_txp; i++)
+ iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_TXP, i);
+ if (phy_db->calib_ch_group_txp != NULL)
+ free(phy_db->calib_ch_group_txp, M_DEVBUF);
+
+ free(phy_db, M_DEVBUF);
+}
+
int
-iwm_phy_db_set_section(struct iwm_softc *sc,
- struct iwm_calib_res_notif_phy_db *phy_db_notif)
+iwm_phy_db_set_section(struct iwm_phy_db *phy_db,
+ struct iwm_rx_packet *pkt)
{
+ struct iwm_calib_res_notif_phy_db *phy_db_notif =
+ (struct iwm_calib_res_notif_phy_db *)pkt->data;
enum iwm_phy_db_section_type type = le16toh(phy_db_notif->type);
uint16_t size = le16toh(phy_db_notif->length);
struct iwm_phy_db_entry *entry;
uint16_t chg_id = 0;
- if (type == IWM_PHY_DB_CALIB_CHG_PAPD ||
- type == IWM_PHY_DB_CALIB_CHG_TXP)
+ if (!phy_db)
+ return EINVAL;
+
+ if (type == IWM_PHY_DB_CALIB_CHG_PAPD) {
+ chg_id = le16toh(*(uint16_t *)phy_db_notif->data);
+ if (phy_db && !phy_db->calib_ch_group_papd) {
+ /*
+ * Firmware sends the largest index first, so we can use
+ * it to know how much we should allocate.
+ */
+ phy_db->calib_ch_group_papd = malloc(
+ (chg_id + 1) * sizeof(struct iwm_phy_db_entry),
+ M_DEVBUF, M_NOWAIT | M_ZERO);
+ if (!phy_db->calib_ch_group_papd)
+ return ENOMEM;
+ phy_db->n_group_papd = chg_id + 1;
+ }
+ } else if (type == IWM_PHY_DB_CALIB_CHG_TXP) {
chg_id = le16toh(*(uint16_t *)phy_db_notif->data);
+ if (phy_db && !phy_db->calib_ch_group_txp) {
+ /*
+ * Firmware sends the largest index first, so we can use
+ * it to know how much we should allocate.
+ */
+ phy_db->calib_ch_group_txp = malloc(
+ (chg_id + 1) * sizeof(struct iwm_phy_db_entry),
+ M_DEVBUF, M_NOWAIT | M_ZERO);
+ if (!phy_db->calib_ch_group_txp)
+ return ENOMEM;
+ phy_db->n_group_txp = chg_id + 1;
+ }
+ }
- entry = iwm_phy_db_get_section(sc, type, chg_id);
+ entry = iwm_phy_db_get_section(phy_db, type, chg_id);
if (!entry)
return EINVAL;
- if (entry->data)
+ if (entry->data != NULL)
free(entry->data, M_DEVBUF);
entry->data = malloc(size, M_DEVBUF, M_NOWAIT);
if (!entry->data) {
@@ -216,17 +364,18 @@
return ENOMEM;
}
memcpy(entry->data, phy_db_notif->data, size);
+
entry->size = size;
- IWM_DPRINTF(sc, IWM_DEBUG_RESET,
- "%s(%d): [PHYDB]SET: Type %d , Size: %d, data: %p\n",
- __func__, __LINE__, type, size, entry->data);
+ IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
+ "%s(%d): [PHYDB]SET: Type %d , Size: %d\n",
+ __func__, __LINE__, type, size);
return 0;
}
static int
-iwm_is_valid_channel(uint16_t ch_id)
+is_valid_channel(uint16_t ch_id)
{
if (ch_id <= 14 ||
(36 <= ch_id && ch_id <= 64 && ch_id % 4 == 0) ||
@@ -237,9 +386,9 @@
}
static uint8_t
-iwm_ch_id_to_ch_index(uint16_t ch_id)
+ch_id_to_ch_index(uint16_t ch_id)
{
- if (!iwm_is_valid_channel(ch_id))
+ if (!is_valid_channel(ch_id))
return 0xff;
if (ch_id <= 14)
@@ -253,9 +402,9 @@
static uint16_t
-iwm_channel_id_to_papd(uint16_t ch_id)
+channel_id_to_papd(uint16_t ch_id)
{
- if (!iwm_is_valid_channel(ch_id))
+ if (!is_valid_channel(ch_id))
return 0xff;
if (1 <= ch_id && ch_id <= 14)
@@ -268,17 +417,15 @@
}
static uint16_t
-iwm_channel_id_to_txp(struct iwm_softc *sc, uint16_t ch_id)
+channel_id_to_txp(struct iwm_phy_db *phy_db, uint16_t ch_id)
{
- struct iwm_phy_db *phy_db = &sc->sc_phy_db;
struct iwm_phy_db_chg_txp *txp_chg;
int i;
- uint8_t ch_index = iwm_ch_id_to_ch_index(ch_id);
-
+ uint8_t ch_index = ch_id_to_ch_index(ch_id);
if (ch_index == 0xff)
return 0xff;
- for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++) {
+ for (i = 0; i < phy_db->n_group_txp; i++) {
txp_chg = (void *)phy_db->calib_ch_group_txp[i].data;
if (!txp_chg)
return 0xff;
@@ -293,71 +440,79 @@
}
static int
-iwm_phy_db_get_section_data(struct iwm_softc *sc,
- uint32_t type, uint8_t **data, uint16_t *size, uint16_t ch_id)
+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;
- IWM_DPRINTF(sc, IWM_DEBUG_RESET, "->%s\n", __func__);
+ if (!phy_db)
+ return EINVAL;
+
/* find wanted channel group */
if (type == IWM_PHY_DB_CALIB_CHG_PAPD)
- ch_group_id = iwm_channel_id_to_papd(ch_id);
+ ch_group_id = channel_id_to_papd(ch_id);
else if (type == IWM_PHY_DB_CALIB_CHG_TXP)
- ch_group_id = iwm_channel_id_to_txp(sc, ch_id);
+ ch_group_id = channel_id_to_txp(phy_db, ch_id);
- entry = iwm_phy_db_get_section(sc, type, ch_group_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(sc, IWM_DEBUG_RESET,
- "%s(%d): [PHYDB] GET: Type %d , Size: %d\n",
- __func__, __LINE__, type, *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
-iwm_send_phy_db_cmd(struct iwm_softc *sc, uint16_t type,
- uint16_t length, void *data)
+iwm_send_phy_db_cmd(struct iwm_phy_db *phy_db, uint16_t type,
+ uint16_t length, void *data)
{
struct iwm_phy_db_cmd phy_db_cmd;
struct iwm_host_cmd cmd = {
- .id = IWM_PHY_DB_CMD,
- .flags = IWM_CMD_SYNC,
+ .id = PHY_DB_CMD,
};
- IWM_DPRINTF(sc, IWM_DEBUG_CMD,
- "Sending PHY-DB hcmd of type %d, of length %d\n",
- type, length);
+ IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
+ "Sending PHY-DB hcmd of type %d, of length %d\n",
+ type, length);
/* Set phy db cmd variables */
- phy_db_cmd.type = le16toh(type);
- phy_db_cmd.length = le16toh(length);
+ phy_db_cmd.type = htole16(type);
+ phy_db_cmd.length = htole16(length);
/* Set hcmd variables */
cmd.data[0] = &phy_db_cmd;
cmd.len[0] = sizeof(struct iwm_phy_db_cmd);
cmd.data[1] = data;
cmd.len[1] = length;
+#ifdef notyet
+ cmd.dataflags[1] = IWM_HCMD_DFL_NOCOPY;
+#endif
- return iwm_send_cmd(sc, &cmd);
+ return iwm_send_cmd(phy_db->sc, &cmd);
}
static int
-iwm_phy_db_send_all_channel_groups(struct iwm_softc *sc,
- enum iwm_phy_db_section_type type, uint8_t max_ch_groups)
+iwm_phy_db_send_all_channel_groups(struct iwm_phy_db *phy_db,
+ enum iwm_phy_db_section_type type,
+ uint8_t max_ch_groups)
{
uint16_t i;
int err;
struct iwm_phy_db_entry *entry;
- /* Send all the channel-specific groups to operational fw */
+ /* Send all the channel specific groups to operational fw */
for (i = 0; i < max_ch_groups; i++) {
- entry = iwm_phy_db_get_section(sc, type, i);
+ entry = iwm_phy_db_get_section(phy_db,
+ type,
+ i);
if (!entry)
return EINVAL;
@@ -365,16 +520,18 @@
continue;
/* Send the requested PHY DB section */
- err = iwm_send_phy_db_cmd(sc, type, entry->size, entry->data);
+ err = iwm_send_phy_db_cmd(phy_db,
+ type,
+ entry->size,
+ entry->data);
if (err) {
- IWM_DPRINTF(sc, IWM_DEBUG_CMD,
- "%s: Can't SEND phy_db section %d (%d), "
- "err %d\n", __func__, type, i, err);
+ device_printf(phy_db->sc->sc_dev,
+ "Can't SEND phy_db section %d (%d), err %d\n",
+ type, i, err);
return err;
}
- DELAY(1000);
- IWM_DPRINTF(sc, IWM_DEBUG_CMD,
+ IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD,
"Sent PHY_DB HCMD, type = %d num = %d\n", type, i);
}
@@ -382,102 +539,73 @@
}
int
-iwm_send_phy_db_data(struct iwm_softc *sc)
+iwm_send_phy_db_data(struct iwm_phy_db *phy_db)
{
uint8_t *data = NULL;
uint16_t size = 0;
int err;
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
"%s: Sending phy db data and configuration to runtime image\n",
__func__);
/* Send PHY DB CFG section */
- err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CFG, &data, &size, 0);
+ err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CFG,
+ &data, &size, 0);
if (err) {
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ device_printf(phy_db->sc->sc_dev,
"%s: Cannot get Phy DB cfg section, %d\n",
__func__, err);
return err;
}
- err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CFG, size, data);
+ err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CFG, size, data);
if (err) {
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ device_printf(phy_db->sc->sc_dev,
"%s: Cannot send HCMD of Phy DB cfg section, %d\n",
__func__, err);
return err;
}
- err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CALIB_NCH,
+ err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CALIB_NCH,
&data, &size, 0);
if (err) {
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ device_printf(phy_db->sc->sc_dev,
"%s: Cannot get Phy DB non specific channel section, "
"%d\n", __func__, err);
return err;
}
- err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CALIB_NCH, size, data);
+ err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CALIB_NCH, size, data);
if (err) {
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ device_printf(phy_db->sc->sc_dev,
"%s: Cannot send HCMD of Phy DB non specific channel "
"sect, %d\n", __func__, err);
return err;
}
/* Send all the TXP channel specific data */
- err = iwm_phy_db_send_all_channel_groups(sc,
- IWM_PHY_DB_CALIB_CHG_PAPD, IWM_NUM_PAPD_CH_GROUPS);
+ err = iwm_phy_db_send_all_channel_groups(phy_db,
+ IWM_PHY_DB_CALIB_CHG_PAPD, phy_db->n_group_papd);
if (err) {
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ device_printf(phy_db->sc->sc_dev,
"%s: Cannot send channel specific PAPD groups, %d\n",
__func__, err);
return err;
}
/* Send all the TXP channel specific data */
- err = iwm_phy_db_send_all_channel_groups(sc,
- IWM_PHY_DB_CALIB_CHG_TXP, IWM_NUM_TXP_CH_GROUPS);
+ err = iwm_phy_db_send_all_channel_groups(phy_db,
+ IWM_PHY_DB_CALIB_CHG_TXP, phy_db->n_group_txp);
if (err) {
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ device_printf(phy_db->sc->sc_dev,
"%s: Cannot send channel specific TX power groups, "
"%d\n", __func__, err);
return err;
}
- IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
+ IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
"%s: Finished sending phy db non channel data\n",
__func__);
return 0;
}
-
-static void
-iwm_phy_db_free_section(struct iwm_softc *sc,
- enum iwm_phy_db_section_type type, uint16_t chg_id)
-{
- struct iwm_phy_db_entry *entry =
- iwm_phy_db_get_section(sc, type, chg_id);
- if (!entry)
- return;
-
- if (entry->data != NULL)
- free(entry->data, M_DEVBUF);
- entry->data = NULL;
- entry->size = 0;
-}
-
-void
-iwm_phy_db_free(struct iwm_softc *sc)
-{
- int i;
-
- iwm_phy_db_free_section(sc, IWM_PHY_DB_CFG, 0);
- iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_NCH, 0);
-
- for (i = 0; i < IWM_NUM_PAPD_CH_GROUPS; i++)
- iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_PAPD, i);
-
- for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++)
- iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_TXP, i);
-}
Index: sys/dev/iwm/if_iwmreg.h
===================================================================
--- sys/dev/iwm/if_iwmreg.h
+++ sys/dev/iwm/if_iwmreg.h
@@ -2003,45 +2003,6 @@
#define IWM_PHY_CFG_RX_CHAIN_B (1 << 13)
#define IWM_PHY_CFG_RX_CHAIN_C (1 << 14)
-/*
- * PHY db
- */
-
-enum iwm_phy_db_section_type {
- IWM_PHY_DB_CFG = 1,
- IWM_PHY_DB_CALIB_NCH,
- IWM_PHY_DB_UNUSED,
- IWM_PHY_DB_CALIB_CHG_PAPD,
- IWM_PHY_DB_CALIB_CHG_TXP,
- IWM_PHY_DB_MAX
-};
-
-#define IWM_PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */
-
-/*
- * phy db - configure operational ucode
- */
-struct iwm_phy_db_cmd {
- uint16_t type;
- uint16_t length;
- uint8_t data[];
-} __packed;
-
-/* for parsing of tx power channel group data that comes from the firmware */
-struct iwm_phy_db_chg_txp {
- uint32_t space;
- uint16_t max_channel_idx;
-} __packed;
-
-/*
- * phy db - Receive phy db chunk after calibrations
- */
-struct iwm_calib_res_notif_phy_db {
- uint16_t type;
- uint16_t length;
- uint8_t data[];
-} __packed;
-
/* Target of the IWM_NVM_ACCESS_CMD */
enum {
Index: sys/dev/iwm/if_iwmvar.h
===================================================================
--- sys/dev/iwm/if_iwmvar.h
+++ sys/dev/iwm/if_iwmvar.h
@@ -314,25 +314,6 @@
IWM_HCMD_DFL_DUP = (1 << 1),
};
-/*
- * iwlwifi/iwl-phy-db
- */
-
-#define IWM_NUM_PAPD_CH_GROUPS 9
-#define IWM_NUM_TXP_CH_GROUPS 9
-
-struct iwm_phy_db_entry {
- uint16_t size;
- uint8_t *data;
-};
-
-struct iwm_phy_db {
- struct iwm_phy_db_entry cfg;
- struct iwm_phy_db_entry calib_nch;
- struct iwm_phy_db_entry calib_ch_group_papd[IWM_NUM_PAPD_CH_GROUPS];
- struct iwm_phy_db_entry calib_ch_group_txp[IWM_NUM_TXP_CH_GROUPS];
-};
-
struct iwm_int_sta {
uint32_t sta_id;
uint32_t tfd_queue_msk;
@@ -478,7 +459,7 @@
struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX];
struct iwm_nvm_data sc_nvm;
- struct iwm_phy_db sc_phy_db;
+ struct iwm_phy_db *sc_phy_db;
struct iwm_bf_data sc_bf;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 5, 9:09 PM (46 m, 16 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28567421
Default Alt Text
D8541.1778015397.diff (19 KB)
Attached To
Mode
D8541: [iwm] Sync if_iwm_phy_db code with Linux iwlwifi.
Attached
Detach File
Event Timeline
Log In to Comment