Skip to contentSkip to conversation

RDMA/nes: get and print eeprom version

PATCH Applied Chien Tung 2 participants 4 messages Jun 9, 2010 – Jul 28, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore

Chien Tung

author
#0 lore raw

PATCH 1/1 RDMA/nes: get and print eeprom version

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

---
 drivers/infiniband/hw/nes/nes_hw.h    |    3 ++-
 drivers/infiniband/hw/nes/nes_utils.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)
drivers/infiniband/hw/nes/nes_hw.h +2 -1
index bbbfe9f..aa9183d 100644
@@ -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;
drivers/infiniband/hw/nes/nes_utils.c +5 -0
index a9f5dd2..c3697c8 100644
@@ -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;
Signature · 6 lines
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

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.

Signature · 6 lines
Roland Dreier <[email protected]> || 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): adatypckkkf.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org

#3 lore raw
Quoted 4 lines

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.

Quoted 4 lines

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Chien Tung

thanks, applied

Signature · 6 lines
Roland Dreier <[email protected]> || 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html