linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro
@ 2012-12-17 13:38 Sebastian Wankerl
  2012-12-17 13:38 ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Wankerl
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Sebastian Wankerl @ 2012-12-17 13:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Dan Carpenter, devel, linux-kernel,
	Sebastian Wankerl

From: Sebastian Wankerl <sisewank@faui49man10.informatik.uni-erlangen.de>

Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de> 

---
 drivers/staging/wlan-ng/prism2mgmt.c |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 4efa9bc..62b94b0 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -415,11 +415,14 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 			break;
 
 #define REQBASICRATE(N) \
-	if ((count >= N) && DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
-		req->basicrate ## N .data = item->supprates[(N)-1]; \
-		req->basicrate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if ((count >= N) && DOT11_RATE5_ISBASIC_GET( \
+			item->supprates[(N)-1])) { \
+			req->basicrate ## N .data = item->supprates[(N)-1]; \
+			req->basicrate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+		} \
+	} while (0)
 
 	REQBASICRATE(1);
 	REQBASICRATE(2);
@@ -431,11 +434,13 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 	REQBASICRATE(8);
 
 #define REQSUPPRATE(N) \
-	if (count >= N) { \
-		req->supprate ## N .data = item->supprates[(N)-1]; \
-		req->supprate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if (count >= N) { \
+			req->supprate ## N .data = item->supprates[(N)-1]; \
+			req->supprate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+		} \
+	} while (0)
 
 	REQSUPPRATE(1);
 	REQSUPPRATE(2);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines
  2012-12-17 13:38 [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Sebastian Wankerl
@ 2012-12-17 13:38 ` Sebastian Wankerl
  2012-12-17 14:08   ` Dan Carpenter
  2012-12-17 13:38 ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Wankerl
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Sebastian Wankerl @ 2012-12-17 13:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Dan Carpenter, devel, linux-kernel,
	Sebastian Wankerl, Sebastian Ehrenfels

From: Sebastian Wankerl <sisewank@faui49man10.informatik.uni-erlangen.de>

Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>

---
 drivers/staging/wlan-ng/prism2mgmt.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 62b94b0..4b3db73 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -1144,9 +1144,9 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 			/* Enable the port */
 			result = hfa384x_drvr_enable(hw, 0);
 			if (result) {
-				pr_debug
-				("failed to enable port to presniff setting, result=%d\n",
-				     result);
+				pr_debug(
+					"failed to enable port to presniff setting,"
+					"result=%d\n", result);
 				goto failed;
 			}
 		} else {
@@ -1186,18 +1186,20 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 				hfa384x_drvr_stop(hw);
 				result = hfa384x_drvr_start(hw);
 				if (result) {
-					pr_debug
-					    ("failed to restart the card for sniffing, result=%d\n",
-					     result);
+					pr_debug(
+						"failed to restart the card "
+						"for sniffing, result=%d\n",
+						result);
 					goto failed;
 				}
 			} else {
 				/* Disable the port */
 				result = hfa384x_drvr_disable(hw, 0);
 				if (result) {
-					pr_debug
-					    ("failed to enable port for sniffing, result=%d\n",
-					     result);
+					pr_debug(
+						"failed to enable port for "
+						"sniffing, result=%d\n",
+						result);
 					goto failed;
 				}
 			}
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err
  2012-12-17 13:38 [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Sebastian Wankerl
  2012-12-17 13:38 ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Wankerl
@ 2012-12-17 13:38 ` Sebastian Wankerl
  2012-12-17 14:13   ` Dan Carpenter
  2012-12-17 14:00 ` [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Dan Carpenter
  2013-01-17 20:58 ` Greg Kroah-Hartman
  3 siblings, 1 reply; 15+ messages in thread
From: Sebastian Wankerl @ 2012-12-17 13:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Dan Carpenter, devel, linux-kernel,
	Sebastian Wankerl, Sebastian Ehrenfels

From: Sebastian Wankerl <sisewank@faui49man10.informatik.uni-erlangen.de>

We are uncertain if the netdev_struct is properly initialized in each function
call. Please be sure to really review this patch.

Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>

---
 drivers/staging/wlan-ng/prism2mgmt.c |   97 +++++++++++++++++++---------------
 1 file changed, 55 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 4b3db73..ca264b6 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -129,8 +129,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 				     hw->ident_sta_fw.minor,
 				     hw->ident_sta_fw.variant) <
 	    HFA384x_FIRMWARE_VERSION(1, 3, 2)) {
-		printk(KERN_ERR
-		       "HostScan not supported with current firmware (<1.3.2).\n");
+		netdev_err(wlandev->netdev,
+			"HostScan not supported with current firmware (<1.3.2).\n");
 		result = 1;
 		msg->resultcode.data = P80211ENUM_resultcode_not_supported;
 		goto exit;
@@ -143,8 +143,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					  HFA384x_RID_CNFROAMINGMODE,
 					  &roamingmode);
 	if (result) {
-		printk(KERN_ERR "getconfig(ROAMMODE) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			"getconfig(ROAMMODE) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -155,8 +155,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					  HFA384x_RID_CNFROAMINGMODE,
 					  HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
 	if (result) {
-		printk(KERN_ERR "setconfig(ROAMINGMODE) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			"setconfig(ROAMINGMODE) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -176,8 +176,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 		    hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPASSIVESCANCTRL,
 					     word);
 		if (result) {
-			printk(KERN_WARNING "Passive scan not supported with "
-			       "current firmware.  (<1.5.1)\n");
+			netdev_warn(wlandev->netdev,
+				"Passive scan not supported with current "
+				"firmware.  (<1.5.1)\n");
 		}
 	}
 
@@ -203,8 +204,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 	/* Enable the MAC port if it's not already enabled  */
 	result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_PORTSTATUS, &word);
 	if (result) {
-		printk(KERN_ERR "getconfig(PORTSTATUS) failed. "
-		       "result=%d\n", result);
+		netdev_err(wlandev->netdev,
+			"getconfig(PORTSTATUS) failed. result=%d\n",
+			result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -216,7 +218,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					HFA384x_RID_CNFROAMINGMODE,
 					HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
 		if (result) {
-			printk(KERN_ERR
+			netdev_err(wlandev->netdev,
 			       "setconfig(ROAMINGMODE) failed. result=%d\n",
 			       result);
 			msg->resultcode.data =
@@ -232,7 +234,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 						wordbuf,
 						HFA384x_RID_CNFOWNSSID_LEN);
 		if (result) {
-			printk(KERN_ERR "Failed to set OwnSSID.\n");
+			netdev_err(wlandev->netdev, "Failed to set OwnSSID.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -241,7 +243,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 						wordbuf,
 						HFA384x_RID_CNFDESIREDSSID_LEN);
 		if (result) {
-			printk(KERN_ERR "Failed to set DesiredSSID.\n");
+			netdev_err(wlandev->netdev,
+				"Failed to set DesiredSSID.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -251,7 +254,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 						  HFA384x_RID_CNFPORTTYPE,
 						  HFA384x_PORTTYPE_IBSS);
 		if (result) {
-			printk(KERN_ERR "Failed to set CNFPORTTYPE.\n");
+			netdev_err(wlandev->netdev,
+				"Failed to set CNFPORTTYPE.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -261,15 +265,17 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					HFA384x_RID_CREATEIBSS,
 					HFA384x_CREATEIBSS_JOINCREATEIBSS);
 		if (result) {
-			printk(KERN_ERR "Failed to set CREATEIBSS.\n");
+			netdev_err(wlandev->netdev,
+				"Failed to set CREATEIBSS.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
 		}
 		result = hfa384x_drvr_enable(hw, 0);
 		if (result) {
-			printk(KERN_ERR "drvr_enable(0) failed. "
-			       "result=%d\n", result);
+			netdev_err(wlandev->netdev,
+				"drvr_enable(0) failed. " "result=%d\n",
+				result);
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -288,8 +294,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					HFA384x_RID_HOSTSCAN, &scanreq,
 					sizeof(hfa384x_HostScanRequest_data_t));
 	if (result) {
-		printk(KERN_ERR "setconfig(SCANREQUEST) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			"setconfig(SCANREQUEST) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -310,8 +316,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 	if (istmpenable) {
 		result = hfa384x_drvr_disable(hw, 0);
 		if (result) {
-			printk(KERN_ERR "drvr_disable(0) failed. "
-			       "result=%d\n", result);
+			netdev_err(wlandev->netdev,
+				"drvr_disable(0) failed. result=%d\n", result);
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -322,8 +328,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE,
 					  roamingmode);
 	if (result) {
-		printk(KERN_ERR "setconfig(ROAMMODE) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			"setconfig(ROAMMODE) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -372,7 +378,7 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 	req->resultcode.status = P80211ENUM_msgitem_status_data_ok;
 
 	if (!hw->scanresults) {
-		printk(KERN_ERR
+		netdev_err(wlandev->netdev,
 		       "dot11req_scan_results can only be used after a successful dot11req_scan.\n");
 		result = 2;
 		req->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
@@ -555,14 +561,14 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
 					bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
 	if (result) {
-		printk(KERN_ERR "Failed to set CnfOwnSSID\n");
+		netdev_err(wlandev->netdev, "Failed to set CnfOwnSSID\n");
 		goto failed;
 	}
 	result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID,
 					bytebuf,
 					HFA384x_RID_CNFDESIREDSSID_LEN);
 	if (result) {
-		printk(KERN_ERR "Failed to set CnfDesiredSSID\n");
+		netdev_err(wlandev->netdev, "Failed to set CnfDesiredSSID\n");
 		goto failed;
 	}
 
@@ -574,7 +580,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	word = msg->beaconperiod.data;
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNint, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set beacon period=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set beacon period=%d.\n",
+			word);
 		goto failed;
 	}
 
@@ -582,7 +589,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	word = msg->dschannel.data;
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set channel=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set channel=%d.\n",
+			word);
 		goto failed;
 	}
 	/* Basic rates */
@@ -610,7 +618,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set basicrates=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set basicrates=%d.\n",
+			word);
 		goto failed;
 	}
 
@@ -639,13 +648,15 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set supprates=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set supprates=%d.\n",
+			word);
 		goto failed;
 	}
 
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set txrates=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set txrates=%d.\n",
+			word);
 		goto failed;
 	}
 
@@ -659,7 +670,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	/* Enable the Port */
 	result = hfa384x_drvr_enable(hw, 0);
 	if (result) {
-		printk(KERN_ERR "Enable macport failed, result=%d.\n", result);
+		netdev_err(wlandev->netdev,
+			"Enable macport failed, result=%d.\n", result);
 		goto failed;
 	}
 
@@ -704,7 +716,7 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
 	 * state.
 	 */
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
+		netdev_err(wlandev->netdev,
 		       "PDA may only be read " "in the fwload state.\n");
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
@@ -717,7 +729,7 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
 					      msg->pda.data,
 					      HFA384x_PDA_LEN_MAX);
 		if (result) {
-			printk(KERN_ERR
+			netdev_err(wlandev->netdev,
 			       "hfa384x_drvr_readpda() failed, "
 			       "result=%d\n", result);
 
@@ -766,7 +778,7 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
 	struct p80211msg_p2req_ramdl_state *msg = msgp;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
+		netdev_err(wlandev->netdev,
 		       "ramdl_state(): may only be called "
 		       "in the fwload state.\n");
 		msg->resultcode.data =
@@ -825,7 +837,7 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
 	u8 *buf;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
+		netdev_err(wlandev->netdev,
 		       "ramdl_write(): may only be called "
 		       "in the fwload state.\n");
 		msg->resultcode.data =
@@ -885,7 +897,7 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
 	struct p80211msg_p2req_flashdl_state *msg = msgp;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
+		netdev_err(wlandev->netdev,
 		       "flashdl_state(): may only be called "
 		       "in the fwload state.\n");
 		msg->resultcode.data =
@@ -920,8 +932,9 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
 		wlandev->msdstate = WLAN_MSD_HWPRESENT;
 		result = prism2sta_ifstate(wlandev, P80211ENUM_ifstate_fwload);
 		if (result != P80211ENUM_resultcode_success) {
-			printk(KERN_ERR "prism2sta_ifstate(fwload) failed,"
-			       "P80211ENUM_resultcode=%d\n", result);
+			netdev_err(wlandev->netdev,
+				"prism2sta_ifstate(fwload) failed,"
+				"P80211ENUM_resultcode=%d\n", result);
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			result = -1;
@@ -958,7 +971,7 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
 	u8 *buf;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
+		netdev_err(wlandev->netdev,
 		       "flashdl_write(): may only be called "
 		       "in the fwload state.\n");
 		msg->resultcode.data =
@@ -1154,7 +1167,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 
 		}
 
-		printk(KERN_INFO "monitor mode disabled\n");
+		netdev_info(wlandev->netdev, "monitor mode disabled\n");
 		msg->resultcode.data = P80211ENUM_resultcode_success;
 		result = 0;
 		goto exit;
@@ -1287,7 +1300,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 		}
 
 		if (wlandev->netdev->type == ARPHRD_ETHER)
-			printk(KERN_INFO "monitor mode enabled\n");
+			netdev_info(wlandev->netdev, "monitor mode enabled\n");
 
 		/* Set the driver state */
 		/* Do we want the prism2 header? */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro
  2012-12-17 13:38 [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Sebastian Wankerl
  2012-12-17 13:38 ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Wankerl
  2012-12-17 13:38 ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Wankerl
@ 2012-12-17 14:00 ` Dan Carpenter
  2012-12-18 21:47   ` Sebastian Ehrenfels
  2013-01-17 20:58 ` Greg Kroah-Hartman
  3 siblings, 1 reply; 15+ messages in thread
From: Dan Carpenter @ 2012-12-17 14:00 UTC (permalink / raw)
  To: Sebastian Wankerl
  Cc: linux-kernel, Greg Kroah-Hartman, devel, linux-kernel, Sebastian Wankerl

On Mon, Dec 17, 2012 at 02:38:01PM +0100, Sebastian Wankerl wrote:
> From: Sebastian Wankerl <sisewank@faui49man10.informatik.uni-erlangen.de>
> 
> Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
> Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de> 
> 
> ---
>  drivers/staging/wlan-ng/prism2mgmt.c |   25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index 4efa9bc..62b94b0 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -415,11 +415,14 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
>  			break;
>  
>  #define REQBASICRATE(N) \
> -	if ((count >= N) && DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
> -		req->basicrate ## N .data = item->supprates[(N)-1]; \
> -		req->basicrate ## N .status = \
> -			P80211ENUM_msgitem_status_data_ok; \
> -	}
> +	do { \
> +		if ((count >= N) && DOT11_RATE5_ISBASIC_GET( \
> +			item->supprates[(N)-1])) { \

This is a very confusing way to indent.  The proper way is:

	do {                                                                \
		if (count >= N &&                                           \
		    DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) {      \

The "DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])" call should be
on one line if possible.

The start 'c' in count and the 'D' in DOT11_ should be in the same
column.  You will need to add some space characters to make this
work.

> +			req->basicrate ## N .data = item->supprates[(N)-1]; \
> +			req->basicrate ## N .status = \
> +				P80211ENUM_msgitem_status_data_ok; \
> +		} \

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines
  2012-12-17 13:38 ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Wankerl
@ 2012-12-17 14:08   ` Dan Carpenter
  0 siblings, 0 replies; 15+ messages in thread
From: Dan Carpenter @ 2012-12-17 14:08 UTC (permalink / raw)
  To: Sebastian Wankerl
  Cc: linux-kernel, Greg Kroah-Hartman, devel, linux-kernel,
	Sebastian Wankerl, Sebastian Ehrenfels

On Mon, Dec 17, 2012 at 02:38:02PM +0100, Sebastian Wankerl wrote:
> From: Sebastian Wankerl <sisewank@faui49man10.informatik.uni-erlangen.de>
> 

We allow long lines for string literals actually.  Or you can break
it up.

> Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
> Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>
> 
> ---
>  drivers/staging/wlan-ng/prism2mgmt.c |   20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index 62b94b0..4b3db73 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -1144,9 +1144,9 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
>  			/* Enable the port */
>  			result = hfa384x_drvr_enable(hw, 0);
>  			if (result) {
> -				pr_debug
> -				("failed to enable port to presniff setting, result=%d\n",
> -				     result);
> +				pr_debug(
> +					"failed to enable port to presniff setting,"
                                                                                   ^
Space needed.

You may as well put the string on the same line as the pr_debug().
It only costs you one char.

				pr_debug("failed to enable port for sniffing, "
					 "result = %d", result);

> +					"result=%d\n", result);
>  				goto failed;
>  			}

	[ snip ]

>  				/* Disable the port */
>  				result = hfa384x_drvr_disable(hw, 0);
>  				if (result) {
> -					pr_debug
> -					    ("failed to enable port for sniffing, result=%d\n",
> -					     result);
> +					pr_debug(
> +						"failed to enable port for "
                                                           ^^^^^^
Disable.

> +						"sniffing, result=%d\n",
> +						result);
>  					goto failed;
>  				}
>  			}

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err
  2012-12-17 13:38 ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Wankerl
@ 2012-12-17 14:13   ` Dan Carpenter
  0 siblings, 0 replies; 15+ messages in thread
From: Dan Carpenter @ 2012-12-17 14:13 UTC (permalink / raw)
  To: Sebastian Wankerl
  Cc: linux-kernel, Greg Kroah-Hartman, devel, linux-kernel,
	Sebastian Wankerl, Sebastian Ehrenfels

On Mon, Dec 17, 2012 at 02:38:03PM +0100, Sebastian Wankerl wrote:
> @@ -261,15 +265,17 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
>  					HFA384x_RID_CREATEIBSS,
>  					HFA384x_CREATEIBSS_JOINCREATEIBSS);
>  		if (result) {
> -			printk(KERN_ERR "Failed to set CREATEIBSS.\n");
> +			netdev_err(wlandev->netdev,
> +				"Failed to set CREATEIBSS.\n");
>  			msg->resultcode.data =
>  			    P80211ENUM_resultcode_implementation_failure;
>  			goto exit;
>  		}
>  		result = hfa384x_drvr_enable(hw, 0);
>  		if (result) {
> -			printk(KERN_ERR "drvr_enable(0) failed. "
> -			       "result=%d\n", result);
> +			netdev_err(wlandev->netdev,
> +				"drvr_enable(0) failed. " "result=%d\n",
                                                        ^^^

Delete this.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro
  2012-12-17 14:00 ` [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Dan Carpenter
@ 2012-12-18 21:47   ` Sebastian Ehrenfels
  0 siblings, 0 replies; 15+ messages in thread
From: Sebastian Ehrenfels @ 2012-12-18 21:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Carpenter, devel, linux-kernel, linux-kernel, Sebastian Wankerl

From: Sebastian Wankerl <sisewank@faui49man10.informatik.uni-erlangen.de>

Here the hopefully fixed version.

Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de> 

---
 drivers/staging/wlan-ng/prism2mgmt.c |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 4efa9bc..62b94b0 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -415,11 +415,14 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 			break;
 
 #define REQBASICRATE(N) \
-	if ((count >= N) && DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
-		req->basicrate ## N .data = item->supprates[(N)-1]; \
-		req->basicrate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if (count >= N &&
+		    DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
+			req->basicrate ## N .data = item->supprates[(N)-1]; \
+			req->basicrate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+		} \
+	} while (0)
 
 	REQBASICRATE(1);
 	REQBASICRATE(2);
@@ -431,11 +434,13 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 	REQBASICRATE(8);
 
 #define REQSUPPRATE(N) \
-	if (count >= N) { \
-		req->supprate ## N .data = item->supprates[(N)-1]; \
-		req->supprate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if (count >= N) { \
+			req->supprate ## N .data = item->supprates[(N)-1]; \
+			req->supprate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+	} \
+	} while (0)
 
 	REQSUPPRATE(1);
 	REQSUPPRATE(2);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro
  2012-12-17 13:38 [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Sebastian Wankerl
                   ` (2 preceding siblings ...)
  2012-12-17 14:00 ` [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Dan Carpenter
@ 2013-01-17 20:58 ` Greg Kroah-Hartman
  2013-01-17 23:07   ` [i4passt_all] " Sebastian Ehrenfels
  3 siblings, 1 reply; 15+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-17 20:58 UTC (permalink / raw)
  To: Sebastian Wankerl
  Cc: linux-kernel, Dan Carpenter, devel, linux-kernel, Sebastian Wankerl

On Mon, Dec 17, 2012 at 02:38:01PM +0100, Sebastian Wankerl wrote:
> From: Sebastian Wankerl <sisewank@faui49man10.informatik.uni-erlangen.de>
> 
> Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
> Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de> 
> 

Can you please resend all of these, as it seems that there were a number
of different patches redone in this series, and I can't easily determine
which one is the "correct" one.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [i4passt_all] [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro
  2013-01-17 20:58 ` Greg Kroah-Hartman
@ 2013-01-17 23:07   ` Sebastian Ehrenfels
  2013-01-17 23:07     ` Sebastian Ehrenfels
                       ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Sebastian Ehrenfels @ 2013-01-17 23:07 UTC (permalink / raw)
  To: linux-kernel, devel, Greg Kroah-Hartman, Dan Carpenter, linux-kernel

Hello,

>Can you please resend all of these, as it seems that there were a number
>of different patches redone in this series, and I can't easily determine
>which one is the "correct" one.

Here the newest version of all three Patches.

greetings
Sebastian


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro
  2013-01-17 23:07   ` [i4passt_all] " Sebastian Ehrenfels
@ 2013-01-17 23:07     ` Sebastian Ehrenfels
  2013-01-18 21:02       ` Greg Kroah-Hartman
  2013-01-17 23:07     ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Ehrenfels
  2013-01-17 23:07     ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Ehrenfels
  2 siblings, 1 reply; 15+ messages in thread
From: Sebastian Ehrenfels @ 2013-01-17 23:07 UTC (permalink / raw)
  To: linux-kernel, devel, Greg Kroah-Hartman, Dan Carpenter, linux-kernel
  Cc: Sebastian Wankerl

From: Sebastian Wankerl <sisewank@cip.cs.fau.de>

Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de> 

---
 drivers/staging/wlan-ng/prism2mgmt.c |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 4efa9bc..62b94b0 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -415,11 +415,14 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 			break;
 
 #define REQBASICRATE(N) \
-	if ((count >= N) && DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
-		req->basicrate ## N .data = item->supprates[(N)-1]; \
-		req->basicrate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if (count >= N &&
+		    DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
+			req->basicrate ## N .data = item->supprates[(N)-1]; \
+			req->basicrate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+		} \
+	} while (0)
 
 	REQBASICRATE(1);
 	REQBASICRATE(2);
@@ -431,11 +434,13 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 	REQBASICRATE(8);
 
 #define REQSUPPRATE(N) \
-	if (count >= N) { \
-		req->supprate ## N .data = item->supprates[(N)-1]; \
-		req->supprate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if (count >= N) { \
+			req->supprate ## N .data = item->supprates[(N)-1]; \
+			req->supprate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+	} \
+	} while (0)
 
 	REQSUPPRATE(1);
 	REQSUPPRATE(2);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines
  2013-01-17 23:07   ` [i4passt_all] " Sebastian Ehrenfels
  2013-01-17 23:07     ` Sebastian Ehrenfels
@ 2013-01-17 23:07     ` Sebastian Ehrenfels
  2013-01-18 21:00       ` Greg Kroah-Hartman
  2013-01-17 23:07     ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Ehrenfels
  2 siblings, 1 reply; 15+ messages in thread
From: Sebastian Ehrenfels @ 2013-01-17 23:07 UTC (permalink / raw)
  To: linux-kernel, devel, Greg Kroah-Hartman, Dan Carpenter, linux-kernel
  Cc: Sebastian Wankerl, Sebastian Ehrenfels

From: Sebastian Wankerl <sisewank@cip.cs.fau.de>

Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>

---
 drivers/staging/wlan-ng/prism2mgmt.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 62b94b0..4b3db73 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -1144,9 +1144,9 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 			/* Enable the port */
 			result = hfa384x_drvr_enable(hw, 0);
 			if (result) {
-				pr_debug
-				("failed to enable port to presniff setting, result=%d\n",
-				     result);
+				pr_debug(
+					"failed to enable port to presniff setting,"
+					"result=%d\n", result);
 				goto failed;
 			}
 		} else {
@@ -1186,18 +1186,20 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 				hfa384x_drvr_stop(hw);
 				result = hfa384x_drvr_start(hw);
 				if (result) {
-					pr_debug
-					    ("failed to restart the card for sniffing, result=%d\n",
-					     result);
+					pr_debug(
+						"failed to restart the card "
+						"for sniffing, result=%d\n",
+						result);
 					goto failed;
 				}
 			} else {
 				/* Disable the port */
 				result = hfa384x_drvr_disable(hw, 0);
 				if (result) {
-					pr_debug
-					    ("failed to enable port for sniffing, result=%d\n",
-					     result);
+					pr_debug(
+						"failed to enable port for "
+						"sniffing, result=%d\n",
+						result);
 					goto failed;
 				}
 			}
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err
  2013-01-17 23:07   ` [i4passt_all] " Sebastian Ehrenfels
  2013-01-17 23:07     ` Sebastian Ehrenfels
  2013-01-17 23:07     ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Ehrenfels
@ 2013-01-17 23:07     ` Sebastian Ehrenfels
  2013-01-18 21:01       ` Greg Kroah-Hartman
  2 siblings, 1 reply; 15+ messages in thread
From: Sebastian Ehrenfels @ 2013-01-17 23:07 UTC (permalink / raw)
  To: linux-kernel, devel, Greg Kroah-Hartman, Dan Carpenter, linux-kernel
  Cc: Sebastian Wankerl, Sebastian Ehrenfels

From: Sebastian Wankerl <sisewank@cip.cs.fau.de>

We are uncertain if the netdev_struct is properly initialized in each function
call. Please be sure to really review this patch.

Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de>
Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>

---
 drivers/staging/wlan-ng/prism2mgmt.c |  125 +++++++++++++++++++---------------
 1 file changed, 69 insertions(+), 56 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 8404754..d44d9f3 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -129,8 +129,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 				     hw->ident_sta_fw.minor,
 				     hw->ident_sta_fw.variant) <
 	    HFA384x_FIRMWARE_VERSION(1, 3, 2)) {
-		printk(KERN_ERR
-		       "HostScan not supported with current firmware (<1.3.2).\n");
+		netdev_err(wlandev->netdev,
+			   "HostScan not supported with current firmware (<1.3.2).\n");
 		result = 1;
 		msg->resultcode.data = P80211ENUM_resultcode_not_supported;
 		goto exit;
@@ -143,8 +143,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					  HFA384x_RID_CNFROAMINGMODE,
 					  &roamingmode);
 	if (result) {
-		printk(KERN_ERR "getconfig(ROAMMODE) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			   "getconfig(ROAMMODE) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -155,8 +155,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					  HFA384x_RID_CNFROAMINGMODE,
 					  HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
 	if (result) {
-		printk(KERN_ERR "setconfig(ROAMINGMODE) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			   "setconfig(ROAMINGMODE) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -176,8 +176,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 		    hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPASSIVESCANCTRL,
 					     word);
 		if (result) {
-			printk(KERN_WARNING "Passive scan not supported with "
-			       "current firmware.  (<1.5.1)\n");
+			netdev_warn(wlandev->netdev,
+				    "Passive scan not supported with current "
+				    "firmware.  (<1.5.1)\n");
 		}
 	}
 
@@ -203,8 +204,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 	/* Enable the MAC port if it's not already enabled  */
 	result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_PORTSTATUS, &word);
 	if (result) {
-		printk(KERN_ERR "getconfig(PORTSTATUS) failed. "
-		       "result=%d\n", result);
+		netdev_err(wlandev->netdev,
+			   "getconfig(PORTSTATUS) failed. result=%d\n",
+			   result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -216,9 +218,9 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					HFA384x_RID_CNFROAMINGMODE,
 					HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
 		if (result) {
-			printk(KERN_ERR
-			       "setconfig(ROAMINGMODE) failed. result=%d\n",
-			       result);
+			netdev_err(wlandev->netdev,
+				   "setconfig(ROAMINGMODE) failed. result=%d\n",
+				   result);
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -232,7 +234,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 						wordbuf,
 						HFA384x_RID_CNFOWNSSID_LEN);
 		if (result) {
-			printk(KERN_ERR "Failed to set OwnSSID.\n");
+			netdev_err(wlandev->netdev, "Failed to set OwnSSID.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -241,7 +243,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 						wordbuf,
 						HFA384x_RID_CNFDESIREDSSID_LEN);
 		if (result) {
-			printk(KERN_ERR "Failed to set DesiredSSID.\n");
+			netdev_err(wlandev->netdev,
+				   "Failed to set DesiredSSID.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -251,7 +254,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 						  HFA384x_RID_CNFPORTTYPE,
 						  HFA384x_PORTTYPE_IBSS);
 		if (result) {
-			printk(KERN_ERR "Failed to set CNFPORTTYPE.\n");
+			netdev_err(wlandev->netdev,
+				   "Failed to set CNFPORTTYPE.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -261,15 +265,17 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					HFA384x_RID_CREATEIBSS,
 					HFA384x_CREATEIBSS_JOINCREATEIBSS);
 		if (result) {
-			printk(KERN_ERR "Failed to set CREATEIBSS.\n");
+			netdev_err(wlandev->netdev,
+				   "Failed to set CREATEIBSS.\n");
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
 		}
 		result = hfa384x_drvr_enable(hw, 0);
 		if (result) {
-			printk(KERN_ERR "drvr_enable(0) failed. "
-			       "result=%d\n", result);
+			netdev_err(wlandev->netdev,
+				   "drvr_enable(0) failed. result=%d\n",
+				   result);
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -288,8 +294,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 					HFA384x_RID_HOSTSCAN, &scanreq,
 					sizeof(hfa384x_HostScanRequest_data_t));
 	if (result) {
-		printk(KERN_ERR "setconfig(SCANREQUEST) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			   "setconfig(SCANREQUEST) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -310,8 +316,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 	if (istmpenable) {
 		result = hfa384x_drvr_disable(hw, 0);
 		if (result) {
-			printk(KERN_ERR "drvr_disable(0) failed. "
-			       "result=%d\n", result);
+			netdev_err(wlandev->netdev,
+				   "drvr_disable(0) failed. result=%d\n", result);
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			goto exit;
@@ -322,8 +328,8 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE,
 					  roamingmode);
 	if (result) {
-		printk(KERN_ERR "setconfig(ROAMMODE) failed. result=%d\n",
-		       result);
+		netdev_err(wlandev->netdev,
+			   "setconfig(ROAMMODE) failed. result=%d\n", result);
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		goto exit;
@@ -372,8 +378,8 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 	req->resultcode.status = P80211ENUM_msgitem_status_data_ok;
 
 	if (!hw->scanresults) {
-		printk(KERN_ERR
-		       "dot11req_scan_results can only be used after a successful dot11req_scan.\n");
+		netdev_err(wlandev->netdev,
+			   "dot11req_scan_results can only be used after a successful dot11req_scan.\n");
 		result = 2;
 		req->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
 		goto exit;
@@ -555,14 +561,14 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
 					bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
 	if (result) {
-		printk(KERN_ERR "Failed to set CnfOwnSSID\n");
+		netdev_err(wlandev->netdev, "Failed to set CnfOwnSSID\n");
 		goto failed;
 	}
 	result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID,
 					bytebuf,
 					HFA384x_RID_CNFDESIREDSSID_LEN);
 	if (result) {
-		printk(KERN_ERR "Failed to set CnfDesiredSSID\n");
+		netdev_err(wlandev->netdev, "Failed to set CnfDesiredSSID\n");
 		goto failed;
 	}
 
@@ -574,7 +580,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	word = msg->beaconperiod.data;
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNint, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set beacon period=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set beacon period=%d.\n",
+			   word);
 		goto failed;
 	}
 
@@ -582,7 +589,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	word = msg->dschannel.data;
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set channel=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set channel=%d.\n",
+			   word);
 		goto failed;
 	}
 	/* Basic rates */
@@ -610,7 +618,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set basicrates=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set basicrates=%d.\n",
+			   word);
 		goto failed;
 	}
 
@@ -639,13 +648,15 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set supprates=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set supprates=%d.\n",
+			   word);
 		goto failed;
 	}
 
 	result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, word);
 	if (result) {
-		printk(KERN_ERR "Failed to set txrates=%d.\n", word);
+		netdev_err(wlandev->netdev, "Failed to set txrates=%d.\n",
+			   word);
 		goto failed;
 	}
 
@@ -659,7 +670,8 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 	/* Enable the Port */
 	result = hfa384x_drvr_enable(hw, 0);
 	if (result) {
-		printk(KERN_ERR "Enable macport failed, result=%d.\n", result);
+		netdev_err(wlandev->netdev,
+			   "Enable macport failed, result=%d.\n", result);
 		goto failed;
 	}
 
@@ -704,8 +716,8 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
 	 * state.
 	 */
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
-		       "PDA may only be read " "in the fwload state.\n");
+		netdev_err(wlandev->netdev,
+			   "PDA may only be read in the fwload state.\n");
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
@@ -717,9 +729,9 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
 					      msg->pda.data,
 					      HFA384x_PDA_LEN_MAX);
 		if (result) {
-			printk(KERN_ERR
-			       "hfa384x_drvr_readpda() failed, "
-			       "result=%d\n", result);
+			netdev_err(wlandev->netdev,
+				   "hfa384x_drvr_readpda() failed, "
+				   "result=%d\n", result);
 
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
@@ -766,9 +778,9 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
 	struct p80211msg_p2req_ramdl_state *msg = msgp;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
-		       "ramdl_state(): may only be called "
-		       "in the fwload state.\n");
+		netdev_err(wlandev->netdev,
+			   "ramdl_state(): may only be called "
+			   "in the fwload state.\n");
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
@@ -825,9 +837,9 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
 	u8 *buf;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
-		       "ramdl_write(): may only be called "
-		       "in the fwload state.\n");
+		netdev_err(wlandev->netdev,
+			   "ramdl_write(): may only be called "
+			   "in the fwload state.\n");
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
@@ -885,9 +897,9 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
 	struct p80211msg_p2req_flashdl_state *msg = msgp;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
-		       "flashdl_state(): may only be called "
-		       "in the fwload state.\n");
+		netdev_err(wlandev->netdev,
+			   "flashdl_state(): may only be called "
+			   "in the fwload state.\n");
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
@@ -920,8 +932,9 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
 		wlandev->msdstate = WLAN_MSD_HWPRESENT;
 		result = prism2sta_ifstate(wlandev, P80211ENUM_ifstate_fwload);
 		if (result != P80211ENUM_resultcode_success) {
-			printk(KERN_ERR "prism2sta_ifstate(fwload) failed,"
-			       "P80211ENUM_resultcode=%d\n", result);
+			netdev_err(wlandev->netdev,
+				   "prism2sta_ifstate(fwload) failed,"
+				   "P80211ENUM_resultcode=%d\n", result);
 			msg->resultcode.data =
 			    P80211ENUM_resultcode_implementation_failure;
 			result = -1;
@@ -958,9 +971,9 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
 	u8 *buf;
 
 	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-		printk(KERN_ERR
-		       "flashdl_write(): may only be called "
-		       "in the fwload state.\n");
+		netdev_err(wlandev->netdev,
+			   "flashdl_write(): may only be called "
+			   "in the fwload state.\n");
 		msg->resultcode.data =
 		    P80211ENUM_resultcode_implementation_failure;
 		msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
@@ -1154,7 +1167,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 
 		}
 
-		printk(KERN_INFO "monitor mode disabled\n");
+		netdev_info(wlandev->netdev, "monitor mode disabled\n");
 		msg->resultcode.data = P80211ENUM_resultcode_success;
 		result = 0;
 		goto exit;
@@ -1285,7 +1298,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 		}
 
 		if (wlandev->netdev->type == ARPHRD_ETHER)
-			printk(KERN_INFO "monitor mode enabled\n");
+			netdev_info(wlandev->netdev, "monitor mode enabled\n");
 
 		/* Set the driver state */
 		/* Do we want the prism2 header? */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines
  2013-01-17 23:07     ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Ehrenfels
@ 2013-01-18 21:00       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-18 21:00 UTC (permalink / raw)
  To: Sebastian Ehrenfels
  Cc: linux-kernel, devel, Dan Carpenter, linux-kernel, Sebastian Wankerl

On Fri, Jan 18, 2013 at 12:07:31AM +0100, Sebastian Ehrenfels wrote:
> From: Sebastian Wankerl <sisewank@cip.cs.fau.de>
> 
> Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
> Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de>
> 
> ---
>  drivers/staging/wlan-ng/prism2mgmt.c |   20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index 62b94b0..4b3db73 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -1144,9 +1144,9 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
>  			/* Enable the port */
>  			result = hfa384x_drvr_enable(hw, 0);
>  			if (result) {
> -				pr_debug
> -				("failed to enable port to presniff setting, result=%d\n",
> -				     result);
> +				pr_debug(
> +					"failed to enable port to presniff setting,"
> +					"result=%d\n", result);

No, please put the string on the same line as the pr_debug() call, and
don't break it across multiple lines.  This should look like:
				pr_debug("failed to enable port to presniff setting,result=%d\n",
					 result);

Can you please fix this up and resend it?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err
  2013-01-17 23:07     ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Ehrenfels
@ 2013-01-18 21:01       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-18 21:01 UTC (permalink / raw)
  To: Sebastian Ehrenfels
  Cc: linux-kernel, devel, Dan Carpenter, linux-kernel, Sebastian Wankerl

On Fri, Jan 18, 2013 at 12:07:32AM +0100, Sebastian Ehrenfels wrote:
> From: Sebastian Wankerl <sisewank@cip.cs.fau.de>
> 
> We are uncertain if the netdev_struct is properly initialized in each function
> call. Please be sure to really review this patch.

If you are uncertian, then I'm sure not going to take this.  Please test
or do whatever you need to do to be certain :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro
  2013-01-17 23:07     ` Sebastian Ehrenfels
@ 2013-01-18 21:02       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-18 21:02 UTC (permalink / raw)
  To: Sebastian Ehrenfels
  Cc: linux-kernel, devel, Dan Carpenter, linux-kernel, Sebastian Wankerl

On Fri, Jan 18, 2013 at 12:07:30AM +0100, Sebastian Ehrenfels wrote:
> From: Sebastian Wankerl <sisewank@cip.cs.fau.de>
> 
> Signed-off-by: Sebastian Wankerl <sisewank@cip.cs.fau.de> 
> Signed-off-by: Sebastian Ehrenfels <qi50dube@cip.cs.fau.de> 

Why did you do this?  What does this fix?  Please always say that in the
change log entry part of the patch, empty ones aren't ok.

And why do you have trailing spaces on your signed-off-by: lines?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-01-18 21:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 13:38 [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Sebastian Wankerl
2012-12-17 13:38 ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Wankerl
2012-12-17 14:08   ` Dan Carpenter
2012-12-17 13:38 ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Wankerl
2012-12-17 14:13   ` Dan Carpenter
2012-12-17 14:00 ` [PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro Dan Carpenter
2012-12-18 21:47   ` Sebastian Ehrenfels
2013-01-17 20:58 ` Greg Kroah-Hartman
2013-01-17 23:07   ` [i4passt_all] " Sebastian Ehrenfels
2013-01-17 23:07     ` Sebastian Ehrenfels
2013-01-18 21:02       ` Greg Kroah-Hartman
2013-01-17 23:07     ` [PATCH 2/3] wlan-ng/prism2mgmt.c: formated too long lines Sebastian Ehrenfels
2013-01-18 21:00       ` Greg Kroah-Hartman
2013-01-17 23:07     ` [PATCH 3/3] wlan-ng/prism2mgmt.c Replace printk(...) with netdev_warn, netdev_err Sebastian Ehrenfels
2013-01-18 21:01       ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).