提交 8da91571 编写于 作者: J Jes Sorensen 提交者: Kalle Valo

rtl8xxxu: rtl8xxxu_h2c_cmd(): Add size argument

The firmware command API differs slightly between new and old
devices. The new generation requires the size since there is no
extension bit encoded into the command number.
Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 b8ba8602
...@@ -1471,7 +1471,8 @@ static int rtl8xxxu_write_rfreg(struct rtl8xxxu_priv *priv, ...@@ -1471,7 +1471,8 @@ static int rtl8xxxu_write_rfreg(struct rtl8xxxu_priv *priv,
return retval; return retval;
} }
static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c) static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv,
struct h2c_cmd *h2c, int len)
{ {
struct device *dev = &priv->udev->dev; struct device *dev = &priv->udev->dev;
int mbox_nr, retry, retval = 0; int mbox_nr, retry, retval = 0;
...@@ -1504,7 +1505,7 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c) ...@@ -1504,7 +1505,7 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c)
/* /*
* Need to swap as it's being swapped again by rtl8xxxu_write16/32() * Need to swap as it's being swapped again by rtl8xxxu_write16/32()
*/ */
if (h2c->cmd.cmd & H2C_EXT) { if (len > sizeof(u32)) {
if (priv->fops->mbox_ext_width == 4) { if (priv->fops->mbox_ext_width == 4) {
rtl8xxxu_write32(priv, mbox_ext_reg, rtl8xxxu_write32(priv, mbox_ext_reg,
le32_to_cpu(h2c->raw_wide.ext)); le32_to_cpu(h2c->raw_wide.ext));
...@@ -5110,9 +5111,9 @@ static void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, ...@@ -5110,9 +5111,9 @@ static void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv,
if (sgi) if (sgi)
h2c.ramask.arg |= 0x20; h2c.ramask.arg |= 0x20;
dev_dbg(&priv->udev->dev, "%s: rate mask %08x, arg %02x\n", __func__, dev_dbg(&priv->udev->dev, "%s: rate mask %08x, arg %02x, size %li\n",
ramask, h2c.ramask.arg); __func__, ramask, h2c.ramask.arg, sizeof(h2c.ramask));
rtl8723a_h2c_cmd(priv, &h2c); rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ramask));
} }
static void rtl8xxxu_set_basic_rates(struct rtl8xxxu_priv *priv, u32 rate_cfg) static void rtl8xxxu_set_basic_rates(struct rtl8xxxu_priv *priv, u32 rate_cfg)
...@@ -5200,7 +5201,7 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -5200,7 +5201,7 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
h2c.joinbss.data = H2C_JOIN_BSS_DISCONNECT; h2c.joinbss.data = H2C_JOIN_BSS_DISCONNECT;
} }
h2c.joinbss.cmd = H2C_JOIN_BSS_REPORT; h2c.joinbss.cmd = H2C_JOIN_BSS_REPORT;
rtl8723a_h2c_cmd(priv, &h2c); rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.joinbss));
} }
if (changed & BSS_CHANGED_ERP_PREAMBLE) { if (changed & BSS_CHANGED_ERP_PREAMBLE) {
......
...@@ -720,7 +720,6 @@ struct h2c_cmd { ...@@ -720,7 +720,6 @@ struct h2c_cmd {
struct { struct {
u8 cmd; u8 cmd;
u8 data; u8 data;
u8 pad[4];
} __packed joinbss; } __packed joinbss;
struct { struct {
u8 cmd; u8 cmd;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册