Search Linux Wireless

[PATCH] iw: Adding helpful hints for vendor cmd

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

 



Without having access to the source, it was
hard to know the format of vendor oui and sub
cmd. This commit fixes that.

Signed-off-by: Ola Olsson <ola.olsson@xxxxxxxxxxxxxx>
---
 vendor.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/vendor.c b/vendor.c
index d0b4f9e..86c03d1 100644
--- a/vendor.c
+++ b/vendor.c
@@ -55,15 +55,19 @@ static int handle_vendor(struct nl80211_state *state,
 	FILE *file = NULL;
 
 	if (argc < 3)
-		return -EINVAL;
+		return 1;
 
 	res = sscanf(argv[0], "0x%x", &oui);
-	if (res != 1)
-		return -EINVAL;
+	if (res != 1) {
+		printf("Vendor command must start with 0x\n");
+		return 2;
+	}
 
 	res = sscanf(argv[1], "0x%x", &subcmd);
-	if (res != 1)
-		return -EINVAL;
+	if (res != 1) {
+		printf("Sub command must start with 0x\n");
+		return 2;
+	}
 
 	if (!strcmp(argv[2], "-"))
 		file = stdin;
-- 
1.7.9.5

--
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