From patchwork Wed Jun 9 20:19:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chien Tung X-Patchwork-Id: 105211 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o59KK08k024160 for ; Wed, 9 Jun 2010 20:20:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754727Ab0FIUUA (ORCPT ); Wed, 9 Jun 2010 16:20:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:55799 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753064Ab0FIUT7 (ORCPT ); Wed, 9 Jun 2010 16:19:59 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 09 Jun 2010 13:15:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,393,1272870000"; d="scan'208";a="806370847" Received: from unknown (HELO ctung-MOBL.intel.com) ([10.254.25.79]) by fmsmga001.fm.intel.com with SMTP; 09 Jun 2010 13:19:32 -0700 Received: by ctung-MOBL.intel.com (sSMTP sendmail emulation); Wed, 09 Jun 2010 15:19:53 -0500 Date: Wed, 9 Jun 2010 15:19:53 -0500 From: Chien Tung To: Roland Dreier Cc: linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/nes: get and print eeprom version Message-ID: <20100609201953.GA2304@CTUNG-MOBL1> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 09 Jun 2010 20:20:01 +0000 (UTC) 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;