netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH NEXT 0/2]qlcnic: bug fixes
@ 2010-07-24  7:24 amit.salecha
  2010-07-24  7:24 ` [PATCH NEXT 1/2] qlcnic: fix bandwidth check amit.salecha
  2010-07-24  7:24 ` [PATCH NEXT 2/2] qlcnic: diag fixes amit.salecha
  0 siblings, 2 replies; 6+ messages in thread
From: amit.salecha @ 2010-07-24  7:24 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman


Hi
  Sending series of 2 minor fixes.
  Apply them on net-next.

-Amit

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

* [PATCH NEXT 1/2] qlcnic: fix bandwidth check
  2010-07-24  7:24 [PATCH NEXT 0/2]qlcnic: bug fixes amit.salecha
@ 2010-07-24  7:24 ` amit.salecha
  2010-07-25  3:42   ` David Miller
  2010-07-24  7:24 ` [PATCH NEXT 2/2] qlcnic: diag fixes amit.salecha
  1 sibling, 1 reply; 6+ messages in thread
From: amit.salecha @ 2010-07-24  7:24 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, Rajesh Borundia, Amit Kumar Salecha

From: Rajesh Borundia <rajesh.borundia@qlogic.com>

Fix maximum and minmum bandwith value.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic.h |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index e189477..fad8e9a 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -1074,8 +1074,8 @@ struct qlcnic_eswitch {
 /* Return codes for Error handling */
 #define QL_STATUS_INVALID_PARAM	-1
 
-#define MAX_BW			10000
-#define MIN_BW			100
+#define MAX_BW			100
+#define MIN_BW			1
 #define MAX_VLAN_ID		4095
 #define MIN_VLAN_ID		2
 #define MAX_TX_QUEUES		1
@@ -1083,8 +1083,7 @@ struct qlcnic_eswitch {
 #define DEFAULT_MAC_LEARN	1
 
 #define IS_VALID_VLAN(vlan)	(vlan >= MIN_VLAN_ID && vlan <= MAX_VLAN_ID)
-#define IS_VALID_BW(bw)		(bw >= MIN_BW && bw <= MAX_BW \
-							&& (bw % 100) == 0)
+#define IS_VALID_BW(bw)		(bw >= MIN_BW && bw <= MAX_BW)
 #define IS_VALID_TX_QUEUES(que)	(que > 0 && que <= MAX_TX_QUEUES)
 #define IS_VALID_RX_QUEUES(que)	(que > 0 && que <= MAX_RX_QUEUES)
 #define IS_VALID_MODE(mode)	(mode == 0 || mode == 1)
-- 
1.6.0.2


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

* [PATCH NEXT 2/2] qlcnic: diag fixes
  2010-07-24  7:24 [PATCH NEXT 0/2]qlcnic: bug fixes amit.salecha
  2010-07-24  7:24 ` [PATCH NEXT 1/2] qlcnic: fix bandwidth check amit.salecha
@ 2010-07-24  7:24 ` amit.salecha
  2010-07-24 16:53   ` Gustavo F. Padovan
  1 sibling, 1 reply; 6+ messages in thread
From: amit.salecha @ 2010-07-24  7:24 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, Amit Kumar Salecha

From: Amit Kumar Salecha <amit.salecha@qlogic.com>

o Loopback not supported for virtual function.
o netif_device_attach was missing in error path from
  qlcnic_diag_alloc_res

Acked-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic.h         |    2 --
 drivers/net/qlcnic/qlcnic_ethtool.c |   10 ++++++++--
 drivers/net/qlcnic/qlcnic_main.c    |   19 +------------------
 3 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index fad8e9a..9703893 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -1301,8 +1301,6 @@ struct qlcnic_nic_template {
 	int (*get_mac_addr) (struct qlcnic_adapter *, u8*);
 	int (*config_bridged_mode) (struct qlcnic_adapter *, u32);
 	int (*config_led) (struct qlcnic_adapter *, u32, u32);
-	int (*set_ilb_mode) (struct qlcnic_adapter *);
-	void (*clear_ilb_mode) (struct qlcnic_adapter *);
 	int (*start_firmware) (struct qlcnic_adapter *);
 };
 
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 7d6558e..ecce364 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -678,6 +678,12 @@ static int qlcnic_loopback_test(struct net_device *netdev)
 	int max_sds_rings = adapter->max_sds_rings;
 	int ret;
 
+	if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) {
+		dev_warn(&adapter->pdev->dev, "Loopback test is not supported"
+				"for non privilege function\n");
+		return 0;
+	}
+
 	if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
 		return -EIO;
 
@@ -685,13 +691,13 @@ static int qlcnic_loopback_test(struct net_device *netdev)
 	if (ret)
 		goto clear_it;
 
-	ret = adapter->nic_ops->set_ilb_mode(adapter);
+	ret = qlcnic_set_ilb_mode(adapter);
 	if (ret)
 		goto done;
 
 	ret = qlcnic_do_ilb_test(adapter);
 
-	adapter->nic_ops->clear_ilb_mode(adapter);
+	qlcnic_clear_ilb_mode(adapter);
 
 done:
 	qlcnic_diag_free_res(netdev, max_sds_rings);
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index f1f7acf..3002a7f 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -107,8 +107,6 @@ static void qlcnic_config_indev_addr(struct net_device *dev, unsigned long);
 static int qlcnic_start_firmware(struct qlcnic_adapter *);
 
 static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *);
-static void qlcnicvf_clear_ilb_mode(struct qlcnic_adapter *);
-static int qlcnicvf_set_ilb_mode(struct qlcnic_adapter *);
 static int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32);
 static int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32);
 static int qlcnicvf_start_firmware(struct qlcnic_adapter *);
@@ -381,8 +379,6 @@ static struct qlcnic_nic_template qlcnic_ops = {
 	.get_mac_addr = qlcnic_get_mac_address,
 	.config_bridged_mode = qlcnic_config_bridged_mode,
 	.config_led = qlcnic_config_led,
-	.set_ilb_mode = qlcnic_set_ilb_mode,
-	.clear_ilb_mode = qlcnic_clear_ilb_mode,
 	.start_firmware = qlcnic_start_firmware
 };
 
@@ -390,8 +386,6 @@ static struct qlcnic_nic_template qlcnic_vf_ops = {
 	.get_mac_addr = qlcnic_get_mac_address,
 	.config_bridged_mode = qlcnicvf_config_bridged_mode,
 	.config_led = qlcnicvf_config_led,
-	.set_ilb_mode = qlcnicvf_set_ilb_mode,
-	.clear_ilb_mode = qlcnicvf_clear_ilb_mode,
 	.start_firmware = qlcnicvf_start_firmware
 };
 
@@ -1181,6 +1175,7 @@ int qlcnic_diag_alloc_res(struct net_device *netdev, int test)
 
 	ret = qlcnic_fw_create_ctx(adapter);
 	if (ret) {
+		netif_device_attach(netdev);
 		qlcnic_detach(adapter);
 		return ret;
 	}
@@ -2841,18 +2836,6 @@ qlcnicvf_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate)
 	return -EOPNOTSUPP;
 }
 
-static int
-qlcnicvf_set_ilb_mode(struct qlcnic_adapter *adapter)
-{
-	return -EOPNOTSUPP;
-}
-
-static void
-qlcnicvf_clear_ilb_mode(struct qlcnic_adapter *adapter)
-{
-	return;
-}
-
 static ssize_t
 qlcnic_store_bridged_mode(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t len)
-- 
1.6.0.2


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

* Re: [PATCH NEXT 2/2] qlcnic: diag fixes
  2010-07-24  7:24 ` [PATCH NEXT 2/2] qlcnic: diag fixes amit.salecha
@ 2010-07-24 16:53   ` Gustavo F. Padovan
  2010-07-25  3:42     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo F. Padovan @ 2010-07-24 16:53 UTC (permalink / raw)
  To: amit.salecha; +Cc: davem, netdev, ameen.rahman

Hi Amit,

* amit.salecha@qlogic.com <amit.salecha@qlogic.com> [2010-07-24 00:24:26 -0700]:

> From: Amit Kumar Salecha <amit.salecha@qlogic.com>
> 
> o Loopback not supported for virtual function.
> o netif_device_attach was missing in error path from
>   qlcnic_diag_alloc_res

This second part should be a new commit actually. It fixes a different
thing.


-- 
Gustavo F. Padovan
http://padovan.org

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

* Re: [PATCH NEXT 1/2] qlcnic: fix bandwidth check
  2010-07-24  7:24 ` [PATCH NEXT 1/2] qlcnic: fix bandwidth check amit.salecha
@ 2010-07-25  3:42   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-07-25  3:42 UTC (permalink / raw)
  To: amit.salecha; +Cc: netdev, ameen.rahman, rajesh.borundia

From: amit.salecha@qlogic.com
Date: Sat, 24 Jul 2010 00:24:25 -0700

> From: Rajesh Borundia <rajesh.borundia@qlogic.com>
> 
> Fix maximum and minmum bandwith value.
> 
> Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>

Applied.

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

* Re: [PATCH NEXT 2/2] qlcnic: diag fixes
  2010-07-24 16:53   ` Gustavo F. Padovan
@ 2010-07-25  3:42     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-07-25  3:42 UTC (permalink / raw)
  To: gustavo; +Cc: amit.salecha, netdev, ameen.rahman

From: "Gustavo F. Padovan" <gustavo@padovan.org>
Date: Sat, 24 Jul 2010 13:53:43 -0300

> Hi Amit,
> 
> * amit.salecha@qlogic.com <amit.salecha@qlogic.com> [2010-07-24 00:24:26 -0700]:
> 
>> From: Amit Kumar Salecha <amit.salecha@qlogic.com>
>> 
>> o Loopback not supported for virtual function.
>> o netif_device_attach was missing in error path from
>>   qlcnic_diag_alloc_res
> 
> This second part should be a new commit actually. It fixes a different
> thing.

Agreed.

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

end of thread, other threads:[~2010-07-25  3:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-24  7:24 [PATCH NEXT 0/2]qlcnic: bug fixes amit.salecha
2010-07-24  7:24 ` [PATCH NEXT 1/2] qlcnic: fix bandwidth check amit.salecha
2010-07-25  3:42   ` David Miller
2010-07-24  7:24 ` [PATCH NEXT 2/2] qlcnic: diag fixes amit.salecha
2010-07-24 16:53   ` Gustavo F. Padovan
2010-07-25  3:42     ` David Miller

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