public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/nes: get and print eeprom version
@ 2010-06-09 20:19 Chien Tung
  2010-06-09 20:38 ` Roland Dreier
  2010-07-28 22:12 ` Roland Dreier
  0 siblings, 2 replies; 4+ messages in thread
From: Chien Tung @ 2010-06-09 20:19 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA


Read and print eeprom version and save it off for later use.
Also delete a tab.

Signed-off-by: Chien Tung <chien.tin.tung-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/nes/nes_hw.h    |    3 ++-
 drivers/infiniband/hw/nes/nes_utils.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index bbbfe9f..aa9183d 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -1100,11 +1100,12 @@ struct nes_adapter {
 	u32 wqm_wat;
 	u32 core_clock;
 	u32 firmware_version;
+	u32 eeprom_version;
 
 	u32 nic_rx_eth_route_err;
 
 	u32 et_rx_coalesce_usecs;
-	u32	et_rx_max_coalesced_frames;
+	u32 et_rx_max_coalesced_frames;
 	u32 et_rx_coalesce_usecs_irq;
 	u32 et_rx_max_coalesced_frames_irq;
 	u32 et_pkt_rate_low;
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index a9f5dd2..c3697c8 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -190,6 +190,11 @@ int nes_read_eeprom_values(struct nes_device *nesdev, struct nes_adapter *nesada
 		nesadapter->firmware_version = (((u32)(u8)(eeprom_data>>8))  <<  16) +
 				(u32)((u8)eeprom_data);
 
+		eeprom_data = nes_read16_eeprom(nesdev->regs, next_section_address + 10);
+		printk(PFX "EEPROM version %u.%u\n", (u8)(eeprom_data>>8), (u8)eeprom_data);
+		nesadapter->eeprom_version = (((u32)(u8)(eeprom_data>>8))  <<  16) +
+				(u32)((u8)eeprom_data);
+
 no_fw_rev:
 		/* eeprom is valid */
 		eeprom_offset = nesadapter->software_eeprom_offset;
-- 
1.6.4.2

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

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

* Re: [PATCH] RDMA/nes: get and print eeprom version
  2010-06-09 20:19 [PATCH] RDMA/nes: get and print eeprom version Chien Tung
@ 2010-06-09 20:38 ` Roland Dreier
       [not found]   ` <adatypckkkf.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
  2010-07-28 22:12 ` Roland Dreier
  1 sibling, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2010-06-09 20:38 UTC (permalink / raw)
  To: Chien Tung; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Is this something that it might be better to expose via ethtool in the
firmware-version field?  (You can have a string with multiple versions
of different components there, see eg get_drvinfo() in
drivers/net/cxgb3/cxgb3_main.c)

As far as I can see, in the current patch, you have eeprom_version as a
pure write-only field.  So instead of dumping to the kernel log, where
it might get lost and is in any case hard to find, make it easier to
read out when someone needs it.

 - R.
-- 
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH] RDMA/nes: get and print eeprom version
       [not found]   ` <adatypckkkf.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
@ 2010-06-09 21:19     ` Tung, Chien Tin
  0 siblings, 0 replies; 4+ messages in thread
From: Tung, Chien Tin @ 2010-06-09 21:19 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> Is this something that it might be better to expose via ethtool in the
> firmware-version field?  (You can have a string with multiple versions
> of different components there, see eg get_drvinfo() in
> drivers/net/cxgb3/cxgb3_main.c)

The main purpose of the patch is to read the eeprom version number and
save it off for later use.  We will be using that field programmatically
in a later patch.  We can certainly expose it via ethtool but I would
prefer a separate eeprom-version field instead of overloading firmware-version.

> As far as I can see, in the current patch, you have eeprom_version as a
> pure write-only field.  So instead of dumping to the kernel log, where
> it might get lost and is in any case hard to find, make it easier to
> read out when someone needs it.

I typically grep for "iw_nes" when looking for nes prints.  It is convenient
to have version numbers printed instead of asking someone to explicitly run
another command.  If you feel strongly about it I can certainly take the
prints out.

Chien


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

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

* Re: [PATCH] RDMA/nes: get and print eeprom version
  2010-06-09 20:19 [PATCH] RDMA/nes: get and print eeprom version Chien Tung
  2010-06-09 20:38 ` Roland Dreier
@ 2010-07-28 22:12 ` Roland Dreier
  1 sibling, 0 replies; 4+ messages in thread
From: Roland Dreier @ 2010-07-28 22:12 UTC (permalink / raw)
  To: Chien Tung; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

thanks, applied
-- 
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2010-07-28 22:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 20:19 [PATCH] RDMA/nes: get and print eeprom version Chien Tung
2010-06-09 20:38 ` Roland Dreier
     [not found]   ` <adatypckkkf.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
2010-06-09 21:19     ` Tung, Chien Tin
2010-07-28 22:12 ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox