static u8
iwl_mld_nl80211_width_to_fw(enum nl80211_chan_width width)
{ switch (width) { case NL80211_CHAN_WIDTH_20_NOHT: case NL80211_CHAN_WIDTH_20: return IWL_PHY_CHANNEL_MODE20; case NL80211_CHAN_WIDTH_40: return IWL_PHY_CHANNEL_MODE40; case NL80211_CHAN_WIDTH_80: return IWL_PHY_CHANNEL_MODE80; case NL80211_CHAN_WIDTH_160: return IWL_PHY_CHANNEL_MODE160; case NL80211_CHAN_WIDTH_320: return IWL_PHY_CHANNEL_MODE320; default:
WARN(1, "Invalid channel width=%u", width); return IWL_PHY_CHANNEL_MODE20;
}
}
/* Maps the driver specific control channel position (relative to the center * freq) definitions to the fw values
*/
u8 iwl_mld_get_fw_ctrl_pos(conststruct cfg80211_chan_def *chandef)
{ int offs = chandef->chan->center_freq - chandef->center_freq1; int abs_offs = abs(offs);
u8 ret;
if (offs == 0) { /* The FW is expected to check the control channel position only * when in HT/VHT and the channel width is not 20MHz. Return * this value as the default one.
*/ return 0;
}
/* this results in a value 0-7, i.e. fitting into 0b0111 */
ret = (abs_offs - 10) / 20; /* But we need the value to be in 0b1011 because 0b0100 is * IWL_PHY_CTRL_POS_ABOVE, so shift bit 2 up to land in * IWL_PHY_CTRL_POS_OFFS_EXT (0b1000)
*/
ret = (ret & IWL_PHY_CTRL_POS_OFFS_MSK) |
((ret & BIT(2)) << 1); /* and add the above bit */
ret |= (offs > 0) * IWL_PHY_CTRL_POS_ABOVE;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.