Search Linux Wireless

[RFC/RFT 5/9] iwlegacy: use CMD_COPY_PKT on il_send_remove_station

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Stanislaw Gruszka <sgruszka@xxxxxxxxxx>
---
 drivers/net/wireless/iwlegacy/common.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 2778bdf..92979e0 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -2107,29 +2107,29 @@ il_send_remove_station(struct il_priv *il, const u8 * addr, int sta_id,
 {
 	struct il_rx_pkt *pkt;
 	int ret;
-
 	unsigned long flags_spin;
 	struct il_rem_sta_cmd rm_sta_cmd;
 
 	struct il_host_cmd cmd = {
 		.id = C_REM_STA,
 		.len = sizeof(struct il_rem_sta_cmd),
-		.flags = CMD_SYNC,
+		.flags = CMD_SYNC | CMD_COPY_PKT,
 		.data = &rm_sta_cmd,
 	};
 
+	pkt = kmalloc(sizeof(*pkt), GFP_KERNEL);
+	if (!pkt)
+		return -ENOMEM;
+	cmd.pkt_ptr = pkt;
+
 	memset(&rm_sta_cmd, 0, sizeof(rm_sta_cmd));
 	rm_sta_cmd.num_sta = 1;
 	memcpy(&rm_sta_cmd.addr, addr, ETH_ALEN);
 
-	cmd.flags |= CMD_WANT_SKB;
-
 	ret = il_send_cmd(il, &cmd);
-
 	if (ret)
-		return ret;
+		goto out;
 
-	pkt = (struct il_rx_pkt *)cmd.reply_page;
 	if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
 		IL_ERR("Bad return from C_REM_STA (0x%08X)\n", pkt->hdr.flags);
 		ret = -EIO;
@@ -2152,8 +2152,9 @@ il_send_remove_station(struct il_priv *il, const u8 * addr, int sta_id,
 			break;
 		}
 	}
-	il_free_pages(il, cmd.reply_page);
 
+out:
+	kfree(pkt);
 	return ret;
 }
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux