Search Linux Wireless

[RFC/RFT 2/9] iwlegacy: use CMD_COPY_PKT on il3945_get_measurement

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

 



Signed-off-by: Stanislaw Gruszka <sgruszka@xxxxxxxxxx>
---
 drivers/net/wireless/iwlegacy/3945-mac.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index dc1d20c..f7a58f5 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -668,13 +668,18 @@ il3945_get_measurement(struct il_priv *il,
 	struct il_host_cmd cmd = {
 		.id = C_SPECTRUM_MEASUREMENT,
 		.data = (void *)&spectrum,
-		.flags = CMD_WANT_SKB,
+		.flags = CMD_COPY_PKT,
 	};
 	u32 add_time = le64_to_cpu(params->start_time);
 	int rc;
 	int spectrum_resp_status;
 	int duration = le16_to_cpu(params->duration);
 
+	pkt = kmalloc(sizeof(*pkt), GFP_KERNEL);
+	if (!pkt)
+		return -ENOMEM;
+	cmd.pkt_ptr = pkt;
+
 	if (il_is_associated(il))
 		add_time =
 		    il_usecs_to_beacons(il,
@@ -708,12 +713,12 @@ il3945_get_measurement(struct il_priv *il,
 
 	rc = il_send_cmd_sync(il, &cmd);
 	if (rc)
-		return rc;
+		goto out;
 
-	pkt = (struct il_rx_pkt *)cmd.reply_page;
 	if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
 		IL_ERR("Bad return from N_RX_ON_ASSOC command\n");
 		rc = -EIO;
+		goto out;
 	}
 
 	spectrum_resp_status = le16_to_cpu(pkt->u.spectrum.status);
@@ -733,8 +738,8 @@ il3945_get_measurement(struct il_priv *il,
 		break;
 	}
 
-	il_free_pages(il, cmd.reply_page);
-
+out:
+	kfree(pkt);
 	return rc;
 }
 
-- 
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