summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel
diff options
context:
space:
mode:
authorPagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>2025-05-11 19:53:08 +0300
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>2025-05-12 17:19:03 +0300
commitfabddb0267607d483408308d113ec8599038ec04 (patch)
tree66fff6b5f62c927f585561c2831c390ca7be82a9 /drivers/net/wireless/intel
parent691f1f69ba312410a1fe16fff071ac7fbced1fc7 (diff)
downloadlinux-fabddb0267607d483408308d113ec8599038ec04.tar.xz
wifi: iwlwifi: Add helper function to extract device ID
Add iwl_trans_get_device_id() to extract the device ID from the hw_id member in the iwl_trans structure. hw_id member contains both sub-device ID and device ID, with the device ID occupying bits 16 to 31. Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250511195137.4411402701f2.I81cde20de05e3bb993977f8d4bbf90707819347f@changeid
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-trans.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
index d76caf5bf4c9..57a7747c92c4 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
@@ -832,6 +832,8 @@ struct iwl_txq {
* @hw_crf_id: the device CRF ID
* @hw_wfpm_id: the device wfpm ID
* @hw_id: the ID of the device / sub-device
+ * Bits 0:15 represent the sub-device ID
+ * Bits 16:31 represent the device ID.
* @pcie_link_speed: current PCIe link speed (%PCI_EXP_LNKSTA_CLS_*),
* only valid for discrete (not integrated) NICs
* @num_rxqs: number of RX queues allocated by the transport
@@ -1263,4 +1265,9 @@ static inline void iwl_trans_set_info(struct iwl_trans *trans,
*write = *info;
}
+static inline u16 iwl_trans_get_device_id(struct iwl_trans *trans)
+{
+ return u32_get_bits(trans->info.hw_id, GENMASK(31, 16));
+}
+
#endif /* __iwl_trans_h__ */