* [PATCH 3/5] NetXen: Add NETXEN prefix to macros
@ 2007-06-01 11:15 Mithlesh Thukral
2007-06-03 15:50 ` Jeff Garzik
0 siblings, 1 reply; 7+ messages in thread
From: Mithlesh Thukral @ 2007-06-01 11:15 UTC (permalink / raw)
To: netdev; +Cc: amitkale, jeff, mithlesh, netxenproj, rob
NetXen: Add NETXEN prefix to a macro
This patch will add the "NETXEN" prefix to "USER_START" macro.
Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
---
drivers/net/netxen/netxen_nic.h | 4 ++--
drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
drivers/net/netxen/netxen_nic_hw.c | 4 ++--
drivers/net/netxen/netxen_nic_init.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index c74402f..6ce6e99 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -705,7 +705,7 @@ typedef enum {
IMAGE_START = 0x43000, /* compressed image */
SECONDARY_START = 0x200000, /* backup images */
PXE_START = 0x3E0000, /* user defined region */
- USER_START = 0x3E8000, /* User defined region for new boards */
+ NETXEN_USER_START = 0x3E8000, /* User defined region for new boards */
FIXED_START = 0x3F0000 /* backup of crbinit */
} netxen_flash_map_t;
@@ -717,7 +717,7 @@ #define PRIMARY_START (BOOTLD_START)
#define FLASH_CRBINIT_SIZE (0x4000)
#define FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info))
#define FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32))
-#define FLASH_SECONDARY_SIZE (USER_START-SECONDARY_START)
+#define FLASH_SECONDARY_SIZE (NETXEN_USER_START-SECONDARY_START)
#define NUM_PRIMARY_SECTORS (0x20)
#define NUM_CONFIG_SECTORS (1)
#define PFX "NetXen: "
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 16fabb3..f7ddcd0 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -478,7 +478,7 @@ netxen_nic_set_eeprom(struct net_device
return ret;
}
- ret = netxen_rom_se(adapter, USER_START);
+ ret = netxen_rom_se(adapter, NETXEN_USER_START);
if (ret != FLASH_SUCCESS)
return ret;
ret = netxen_rom_se(adapter, FIXED_START);
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index fff3844..ef964b4 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -720,7 +720,7 @@ int netxen_get_flash_mac_addr(struct net
u32 *pmac = (u32 *) & mac[0];
if (netxen_get_flash_block(adapter,
- USER_START +
+ NETXEN_USER_START +
offsetof(struct netxen_new_user_info,
mac_addr),
FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) {
@@ -1224,7 +1224,7 @@ void netxen_nic_flash_print(struct netxe
u32 fw_build = 0;
char brd_name[NETXEN_MAX_SHORT_NAME];
struct netxen_new_user_info user_info;
- int i, addr = USER_START;
+ int i, addr = NETXEN_USER_START;
__le32 *ptr32;
struct netxen_board_info *board_info = &(adapter->ahw.boardcfg);
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index a368924..ac93987 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -654,7 +654,7 @@ void check_erased_flash(struct netxen_ad
int count = 0, erased_errors = 0;
int range;
- range = (addr == USER_START) ? FIXED_START : addr + FLASH_SECTOR_SIZE;
+ range = (addr == NETXEN_USER_START) ? FIXED_START : addr + FLASH_SECTOR_SIZE;
for (i = addr; i < range; i += 4) {
netxen_rom_fast_read(adapter, i, &val);
@@ -707,7 +707,7 @@ netxen_flash_erase_secondary(struct netx
int start, end;
start = SECONDARY_START / FLASH_SECTOR_SIZE;
- end = USER_START / FLASH_SECTOR_SIZE;
+ end = NETXEN_USER_START / FLASH_SECTOR_SIZE;
ret = netxen_flash_erase_sections(adapter, start, end);
return ret;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] NetXen: Add NETXEN prefix to macros
2007-06-01 11:15 [PATCH 3/5] NetXen: Add NETXEN prefix to macros Mithlesh Thukral
@ 2007-06-03 15:50 ` Jeff Garzik
2007-06-04 18:58 ` Andy Gospodarek
2007-06-06 17:52 ` wendy xiong
0 siblings, 2 replies; 7+ messages in thread
From: Jeff Garzik @ 2007-06-03 15:50 UTC (permalink / raw)
To: Mithlesh Thukral; +Cc: netdev, amitkale, netxenproj, rob
Mithlesh Thukral wrote:
> NetXen: Add NETXEN prefix to a macro
> This patch will add the "NETXEN" prefix to "USER_START" macro.
>
> Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
> Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
> ---
>
> drivers/net/netxen/netxen_nic.h | 4 ++--
> drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
> drivers/net/netxen/netxen_nic_hw.c | 4 ++--
> drivers/net/netxen/netxen_nic_init.c | 4 ++--
> 4 files changed, 7 insertions(+), 7 deletions(-)
Your patch description is useless. Clearly we know -what- it does,
simply by reading the patch.
But it does not answer the simple question: why? why is this needed in
a bug fix Release Candidate series?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] NetXen: Add NETXEN prefix to macros
2007-06-03 15:50 ` Jeff Garzik
@ 2007-06-04 18:58 ` Andy Gospodarek
2007-06-06 11:07 ` Mithlesh Thukral
2007-06-06 17:52 ` wendy xiong
1 sibling, 1 reply; 7+ messages in thread
From: Andy Gospodarek @ 2007-06-04 18:58 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Mithlesh Thukral, netdev, amitkale, netxenproj, rob
On Sun, Jun 03, 2007 at 11:50:29AM -0400, Jeff Garzik wrote:
> Mithlesh Thukral wrote:
> >NetXen: Add NETXEN prefix to a macro
> >This patch will add the "NETXEN" prefix to "USER_START" macro.
> >
> >Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
> >Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
> >---
> >
> > drivers/net/netxen/netxen_nic.h | 4 ++--
> > drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
> > drivers/net/netxen/netxen_nic_hw.c | 4 ++--
> > drivers/net/netxen/netxen_nic_init.c | 4 ++--
> > 4 files changed, 7 insertions(+), 7 deletions(-)
>
> Your patch description is useless. Clearly we know -what- it does,
> simply by reading the patch.
>
> But it does not answer the simple question: why? why is this needed in
> a bug fix Release Candidate series?
>
I can't see why this is needed in an RC branch, but the use of
generically named macros/variables has been problematic with this driver
on more 'obscure' arches.
I submitted a bigger cleanup patch a in March that never got taken so
this is still a problem. Here is that patch:
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
netxen_nic.h | 47 ++++++++++++++++++++++++-----------------------
netxen_nic_ethtool.c | 8 ++++----
netxen_nic_hw.c | 10 +++++-----
netxen_nic_init.c | 23 ++++++++++++-----------
4 files changed, 45 insertions(+), 43 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index dd8ce35..d5f0c06 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -68,9 +68,10 @@
#define _NETXEN_NIC_LINUX_SUBVERSION 3
#define NETXEN_NIC_LINUX_VERSIONID "3.3.3"
-#define NUM_FLASH_SECTORS (64)
-#define FLASH_SECTOR_SIZE (64 * 1024)
-#define FLASH_TOTAL_SIZE (NUM_FLASH_SECTORS * FLASH_SECTOR_SIZE)
+#define NETXEN_NUM_FLASH_SECTORS (64)
+#define NETXEN_FLASH_SECTOR_SIZE (64 * 1024)
+#define NETXEN_FLASH_TOTAL_SIZE (NETXEN_NUM_FLASH_SECTORS \
+ * NETXEN_FLASH_SECTOR_SIZE)
#define PHAN_VENDOR_ID 0x4040
@@ -671,28 +672,28 @@ struct netxen_new_user_info {
/* Flash memory map */
typedef enum {
- CRBINIT_START = 0, /* Crbinit section */
- BRDCFG_START = 0x4000, /* board config */
- INITCODE_START = 0x6000, /* pegtune code */
- BOOTLD_START = 0x10000, /* bootld */
- IMAGE_START = 0x43000, /* compressed image */
- SECONDARY_START = 0x200000, /* backup images */
- PXE_START = 0x3E0000, /* user defined region */
- USER_START = 0x3E8000, /* User defined region for new boards */
- FIXED_START = 0x3F0000 /* backup of crbinit */
+ NETXEN_CRBINIT_START = 0, /* Crbinit section */
+ NETXEN_BRDCFG_START = 0x4000, /* board config */
+ NETXEN_INITCODE_START = 0x6000, /* pegtune code */
+ NETXEN_BOOTLD_START = 0x10000, /* bootld */
+ NETXEN_IMAGE_START = 0x43000, /* compressed image */
+ NETXEN_SECONDARY_START = 0x200000, /* backup images */
+ NETXEN_PXE_START = 0x3E0000, /* user defined region */
+ NETXEN_USER_START = 0x3E8000, /* User defined region for new boards */
+ NETXEN_FIXED_START = 0x3F0000 /* backup of crbinit */
} netxen_flash_map_t;
-#define USER_START_OLD PXE_START /* for backward compatibility */
-
-#define FLASH_START (CRBINIT_START)
-#define INIT_SECTOR (0)
-#define PRIMARY_START (BOOTLD_START)
-#define FLASH_CRBINIT_SIZE (0x4000)
-#define FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info))
-#define FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32))
-#define FLASH_SECONDARY_SIZE (USER_START-SECONDARY_START)
-#define NUM_PRIMARY_SECTORS (0x20)
-#define NUM_CONFIG_SECTORS (1)
+#define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */
+
+#define NETXEN_FLASH_START (NETXEN_CRBINIT_START)
+#define NETXEN_INIT_SECTOR (0)
+#define NETXEN_PRIMARY_START (NETXEN_BOOTLD_START)
+#define NETXEN_FLASH_CRBINIT_SIZE (0x4000)
+#define NETXEN_FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info))
+#define NETXEN_FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32))
+#define NETXEN_FLASH_SECONDARY_SIZE (NETXEN_USER_START-NETXEN_SECONDARY_START)
+#define NETXEN_NUM_PRIMARY_SECTORS (0x20)
+#define NETXEN_NUM_CONFIG_SECTORS (1)
#define PFX "NetXen: "
extern char netxen_nic_driver_name[];
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index ee1b5a2..4dfa76b 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -94,7 +94,7 @@ static const char netxen_nic_gstrings_test[][ETH_GSTRING_LEN] = {
static int netxen_nic_get_eeprom_len(struct net_device *dev)
{
- return FLASH_TOTAL_SIZE;
+ return NETXEN_FLASH_TOTAL_SIZE;
}
static void
@@ -475,7 +475,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
return 0;
}
- if (offset == BOOTLD_START) {
+ if (offset == NETXEN_BOOTLD_START) {
ret = netxen_flash_erase_primary(adapter);
if (ret != FLASH_SUCCESS) {
printk(KERN_ERR "%s: Flash erase failed.\n",
@@ -483,10 +483,10 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
return ret;
}
- ret = netxen_rom_se(adapter, USER_START);
+ ret = netxen_rom_se(adapter, NETXEN_USER_START);
if (ret != FLASH_SUCCESS)
return ret;
- ret = netxen_rom_se(adapter, FIXED_START);
+ ret = netxen_rom_se(adapter, NETXEN_FIXED_START);
if (ret != FLASH_SUCCESS)
return ret;
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 6537574..2fe7a3f 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -40,7 +40,7 @@
#define ADDR_IN_RANGE(addr, low, high) \
(((addr) <= (high)) && ((addr) >= (low)))
-#define NETXEN_FLASH_BASE (BOOTLD_START)
+#define NETXEN_FLASH_BASE (NETXEN_BOOTLD_START)
#define NETXEN_PHANTOM_MEM_BASE (NETXEN_FLASH_BASE)
#define NETXEN_MAX_MTU 8000 + NETXEN_ENET_HEADER_SIZE + NETXEN_ETH_FCS_SIZE
#define NETXEN_MIN_MTU 64
@@ -443,7 +443,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
u32 *pmac = (u32 *) & mac[0];
if (netxen_get_flash_block(adapter,
- USER_START +
+ NETXEN_USER_START +
offsetof(struct netxen_new_user_info,
mac_addr),
FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) {
@@ -451,7 +451,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
}
if (*mac == ~0ULL) {
if (netxen_get_flash_block(adapter,
- USER_START_OLD +
+ NETXEN_USER_START_OLD +
offsetof(struct netxen_user_old_info,
mac_addr),
FLASH_NUM_PORTS * sizeof(u64),
@@ -751,7 +751,7 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter,
int netxen_nic_get_board_info(struct netxen_adapter *adapter)
{
int rv = 0;
- int addr = BRDCFG_START;
+ int addr = NETXEN_BRDCFG_START;
struct netxen_board_info *boardinfo;
int index;
u32 *ptr32;
@@ -928,7 +928,7 @@ void netxen_nic_flash_print(struct netxen_adapter *adapter)
u32 fw_build = 0;
char brd_name[NETXEN_MAX_SHORT_NAME];
struct netxen_new_user_info user_info;
- int i, addr = USER_START;
+ int i, addr = NETXEN_USER_START;
u32 *ptr32;
struct netxen_board_info *board_info = &(adapter->ahw.boardcfg);
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 229aa1c..abdc04b 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -586,7 +586,7 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
{
int ret = FLASH_SUCCESS;
int val;
- char *buffer = kmalloc(FLASH_SECTOR_SIZE, GFP_KERNEL);
+ char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
@@ -602,13 +602,13 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
goto out_kfree;
/* copy sector 0 to sector 63 */
- ret = netxen_rom_fast_read_words(adapter, CRBINIT_START,
- buffer, FLASH_SECTOR_SIZE);
+ ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START,
+ buffer, NETXEN_FLASH_SECTOR_SIZE);
if (ret != FLASH_SUCCESS)
goto out_kfree;
- ret = netxen_rom_fast_write_words(adapter, FIXED_START,
- buffer, FLASH_SECTOR_SIZE);
+ ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START,
+ buffer, NETXEN_FLASH_SECTOR_SIZE);
if (ret != FLASH_SUCCESS)
goto out_kfree;
@@ -655,7 +655,8 @@ void check_erased_flash(struct netxen_adapter *adapter, int addr)
int count = 0, erased_errors = 0;
int range;
- range = (addr == USER_START) ? FIXED_START : addr + FLASH_SECTOR_SIZE;
+ range = (addr == NETXEN_USER_START) ?
+ NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE;
for (i = addr; i < range; i += 4) {
netxen_rom_fast_read(adapter, i, &val);
@@ -690,7 +691,7 @@ netxen_flash_erase_sections(struct netxen_adapter *adapter, int start, int end)
int i;
for (i = start; i < end; i++) {
- ret = netxen_rom_se(adapter, i * FLASH_SECTOR_SIZE);
+ ret = netxen_rom_se(adapter, i * NETXEN_FLASH_SECTOR_SIZE);
if (ret)
break;
ret = netxen_rom_wip_poll(adapter);
@@ -707,8 +708,8 @@ netxen_flash_erase_secondary(struct netxen_adapter *adapter)
int ret = FLASH_SUCCESS;
int start, end;
- start = SECONDARY_START / FLASH_SECTOR_SIZE;
- end = USER_START / FLASH_SECTOR_SIZE;
+ start = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE;
+ end = NETXEN_USER_START / NETXEN_FLASH_SECTOR_SIZE;
ret = netxen_flash_erase_sections(adapter, start, end);
return ret;
@@ -720,8 +721,8 @@ netxen_flash_erase_primary(struct netxen_adapter *adapter)
int ret = FLASH_SUCCESS;
int start, end;
- start = PRIMARY_START / FLASH_SECTOR_SIZE;
- end = SECONDARY_START / FLASH_SECTOR_SIZE;
+ start = NETXEN_PRIMARY_START / NETXEN_FLASH_SECTOR_SIZE;
+ end = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE;
ret = netxen_flash_erase_sections(adapter, start, end);
return ret;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] NetXen: Add NETXEN prefix to macros
2007-06-04 18:58 ` Andy Gospodarek
@ 2007-06-06 11:07 ` Mithlesh Thukral
0 siblings, 0 replies; 7+ messages in thread
From: Mithlesh Thukral @ 2007-06-06 11:07 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: Jeff Garzik, netdev, amitkale, netxenproj, rob
He seems to be the same guy who has dropped the patches from RHEL5 bugzilla
for now.
--
Mithlesh Thukral
On Tuesday 05 June 2007 00:28, Andy Gospodarek wrote:
> On Sun, Jun 03, 2007 at 11:50:29AM -0400, Jeff Garzik wrote:
> > Mithlesh Thukral wrote:
> > >NetXen: Add NETXEN prefix to a macro
> > >This patch will add the "NETXEN" prefix to "USER_START" macro.
> > >
> > >Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
> > >Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
> > >---
> > >
> > > drivers/net/netxen/netxen_nic.h | 4 ++--
> > > drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
> > > drivers/net/netxen/netxen_nic_hw.c | 4 ++--
> > > drivers/net/netxen/netxen_nic_init.c | 4 ++--
> > > 4 files changed, 7 insertions(+), 7 deletions(-)
> >
> > Your patch description is useless. Clearly we know -what- it does,
> > simply by reading the patch.
> >
> > But it does not answer the simple question: why? why is this needed in
> > a bug fix Release Candidate series?
>
> I can't see why this is needed in an RC branch, but the use of
> generically named macros/variables has been problematic with this driver
> on more 'obscure' arches.
>
> I submitted a bigger cleanup patch a in March that never got taken so
> this is still a problem. Here is that patch:
>
> Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
> ---
>
> netxen_nic.h | 47
> ++++++++++++++++++++++++----------------------- netxen_nic_ethtool.c | 8
> ++++----
> netxen_nic_hw.c | 10 +++++-----
> netxen_nic_init.c | 23 ++++++++++++-----------
> 4 files changed, 45 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/net/netxen/netxen_nic.h
> b/drivers/net/netxen/netxen_nic.h index dd8ce35..d5f0c06 100644
> --- a/drivers/net/netxen/netxen_nic.h
> +++ b/drivers/net/netxen/netxen_nic.h
> @@ -68,9 +68,10 @@
> #define _NETXEN_NIC_LINUX_SUBVERSION 3
> #define NETXEN_NIC_LINUX_VERSIONID "3.3.3"
>
> -#define NUM_FLASH_SECTORS (64)
> -#define FLASH_SECTOR_SIZE (64 * 1024)
> -#define FLASH_TOTAL_SIZE (NUM_FLASH_SECTORS * FLASH_SECTOR_SIZE)
> +#define NETXEN_NUM_FLASH_SECTORS (64)
> +#define NETXEN_FLASH_SECTOR_SIZE (64 * 1024)
> +#define NETXEN_FLASH_TOTAL_SIZE (NETXEN_NUM_FLASH_SECTORS \
> + * NETXEN_FLASH_SECTOR_SIZE)
>
> #define PHAN_VENDOR_ID 0x4040
>
> @@ -671,28 +672,28 @@ struct netxen_new_user_info {
>
> /* Flash memory map */
> typedef enum {
> - CRBINIT_START = 0, /* Crbinit section */
> - BRDCFG_START = 0x4000, /* board config */
> - INITCODE_START = 0x6000, /* pegtune code */
> - BOOTLD_START = 0x10000, /* bootld */
> - IMAGE_START = 0x43000, /* compressed image */
> - SECONDARY_START = 0x200000, /* backup images */
> - PXE_START = 0x3E0000, /* user defined region */
> - USER_START = 0x3E8000, /* User defined region for new boards */
> - FIXED_START = 0x3F0000 /* backup of crbinit */
> + NETXEN_CRBINIT_START = 0, /* Crbinit section */
> + NETXEN_BRDCFG_START = 0x4000, /* board config */
> + NETXEN_INITCODE_START = 0x6000, /* pegtune code */
> + NETXEN_BOOTLD_START = 0x10000, /* bootld */
> + NETXEN_IMAGE_START = 0x43000, /* compressed image */
> + NETXEN_SECONDARY_START = 0x200000, /* backup images */
> + NETXEN_PXE_START = 0x3E0000, /* user defined region */
> + NETXEN_USER_START = 0x3E8000, /* User defined region for new boards */
> + NETXEN_FIXED_START = 0x3F0000 /* backup of crbinit */
> } netxen_flash_map_t;
>
> -#define USER_START_OLD PXE_START /* for backward compatibility */
> -
> -#define FLASH_START (CRBINIT_START)
> -#define INIT_SECTOR (0)
> -#define PRIMARY_START (BOOTLD_START)
> -#define FLASH_CRBINIT_SIZE (0x4000)
> -#define FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info))
> -#define FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32))
> -#define FLASH_SECONDARY_SIZE (USER_START-SECONDARY_START)
> -#define NUM_PRIMARY_SECTORS (0x20)
> -#define NUM_CONFIG_SECTORS (1)
> +#define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward
> compatibility */ +
> +#define NETXEN_FLASH_START (NETXEN_CRBINIT_START)
> +#define NETXEN_INIT_SECTOR (0)
> +#define NETXEN_PRIMARY_START (NETXEN_BOOTLD_START)
> +#define NETXEN_FLASH_CRBINIT_SIZE (0x4000)
> +#define NETXEN_FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info))
> +#define NETXEN_FLASH_USER_SIZE (sizeof(struct
> netxen_user_info)/sizeof(u32)) +#define NETXEN_FLASH_SECONDARY_SIZE
> (NETXEN_USER_START-NETXEN_SECONDARY_START) +#define
> NETXEN_NUM_PRIMARY_SECTORS (0x20)
> +#define NETXEN_NUM_CONFIG_SECTORS (1)
> #define PFX "NetXen: "
> extern char netxen_nic_driver_name[];
>
> diff --git a/drivers/net/netxen/netxen_nic_ethtool.c
> b/drivers/net/netxen/netxen_nic_ethtool.c index ee1b5a2..4dfa76b 100644
> --- a/drivers/net/netxen/netxen_nic_ethtool.c
> +++ b/drivers/net/netxen/netxen_nic_ethtool.c
> @@ -94,7 +94,7 @@ static const char
> netxen_nic_gstrings_test[][ETH_GSTRING_LEN] = {
>
> static int netxen_nic_get_eeprom_len(struct net_device *dev)
> {
> - return FLASH_TOTAL_SIZE;
> + return NETXEN_FLASH_TOTAL_SIZE;
> }
>
> static void
> @@ -475,7 +475,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct
> ethtool_eeprom *eeprom, return 0;
> }
>
> - if (offset == BOOTLD_START) {
> + if (offset == NETXEN_BOOTLD_START) {
> ret = netxen_flash_erase_primary(adapter);
> if (ret != FLASH_SUCCESS) {
> printk(KERN_ERR "%s: Flash erase failed.\n",
> @@ -483,10 +483,10 @@ netxen_nic_set_eeprom(struct net_device *dev, struct
> ethtool_eeprom *eeprom, return ret;
> }
>
> - ret = netxen_rom_se(adapter, USER_START);
> + ret = netxen_rom_se(adapter, NETXEN_USER_START);
> if (ret != FLASH_SUCCESS)
> return ret;
> - ret = netxen_rom_se(adapter, FIXED_START);
> + ret = netxen_rom_se(adapter, NETXEN_FIXED_START);
> if (ret != FLASH_SUCCESS)
> return ret;
>
> diff --git a/drivers/net/netxen/netxen_nic_hw.c
> b/drivers/net/netxen/netxen_nic_hw.c index 6537574..2fe7a3f 100644
> --- a/drivers/net/netxen/netxen_nic_hw.c
> +++ b/drivers/net/netxen/netxen_nic_hw.c
> @@ -40,7 +40,7 @@
> #define ADDR_IN_RANGE(addr, low, high) \
> (((addr) <= (high)) && ((addr) >= (low)))
>
> -#define NETXEN_FLASH_BASE (BOOTLD_START)
> +#define NETXEN_FLASH_BASE (NETXEN_BOOTLD_START)
> #define NETXEN_PHANTOM_MEM_BASE (NETXEN_FLASH_BASE)
> #define NETXEN_MAX_MTU 8000 + NETXEN_ENET_HEADER_SIZE +
> NETXEN_ETH_FCS_SIZE #define NETXEN_MIN_MTU 64
> @@ -443,7 +443,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter
> *adapter, u64 mac[]) u32 *pmac = (u32 *) & mac[0];
>
> if (netxen_get_flash_block(adapter,
> - USER_START +
> + NETXEN_USER_START +
> offsetof(struct netxen_new_user_info,
> mac_addr),
> FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) {
> @@ -451,7 +451,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter
> *adapter, u64 mac[]) }
> if (*mac == ~0ULL) {
> if (netxen_get_flash_block(adapter,
> - USER_START_OLD +
> + NETXEN_USER_START_OLD +
> offsetof(struct netxen_user_old_info,
> mac_addr),
> FLASH_NUM_PORTS * sizeof(u64),
> @@ -751,7 +751,7 @@ netxen_nic_pci_set_window(struct netxen_adapter
> *adapter, int netxen_nic_get_board_info(struct netxen_adapter *adapter)
> {
> int rv = 0;
> - int addr = BRDCFG_START;
> + int addr = NETXEN_BRDCFG_START;
> struct netxen_board_info *boardinfo;
> int index;
> u32 *ptr32;
> @@ -928,7 +928,7 @@ void netxen_nic_flash_print(struct netxen_adapter
> *adapter) u32 fw_build = 0;
> char brd_name[NETXEN_MAX_SHORT_NAME];
> struct netxen_new_user_info user_info;
> - int i, addr = USER_START;
> + int i, addr = NETXEN_USER_START;
> u32 *ptr32;
>
> struct netxen_board_info *board_info = &(adapter->ahw.boardcfg);
> diff --git a/drivers/net/netxen/netxen_nic_init.c
> b/drivers/net/netxen/netxen_nic_init.c index 229aa1c..abdc04b 100644
> --- a/drivers/net/netxen/netxen_nic_init.c
> +++ b/drivers/net/netxen/netxen_nic_init.c
> @@ -586,7 +586,7 @@ int netxen_backup_crbinit(struct netxen_adapter
> *adapter) {
> int ret = FLASH_SUCCESS;
> int val;
> - char *buffer = kmalloc(FLASH_SECTOR_SIZE, GFP_KERNEL);
> + char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL);
>
> if (!buffer)
> return -ENOMEM;
> @@ -602,13 +602,13 @@ int netxen_backup_crbinit(struct netxen_adapter
> *adapter) goto out_kfree;
>
> /* copy sector 0 to sector 63 */
> - ret = netxen_rom_fast_read_words(adapter, CRBINIT_START,
> - buffer, FLASH_SECTOR_SIZE);
> + ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START,
> + buffer, NETXEN_FLASH_SECTOR_SIZE);
> if (ret != FLASH_SUCCESS)
> goto out_kfree;
>
> - ret = netxen_rom_fast_write_words(adapter, FIXED_START,
> - buffer, FLASH_SECTOR_SIZE);
> + ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START,
> + buffer, NETXEN_FLASH_SECTOR_SIZE);
> if (ret != FLASH_SUCCESS)
> goto out_kfree;
>
> @@ -655,7 +655,8 @@ void check_erased_flash(struct netxen_adapter *adapter,
> int addr) int count = 0, erased_errors = 0;
> int range;
>
> - range = (addr == USER_START) ? FIXED_START : addr + FLASH_SECTOR_SIZE;
> + range = (addr == NETXEN_USER_START) ?
> + NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE;
>
> for (i = addr; i < range; i += 4) {
> netxen_rom_fast_read(adapter, i, &val);
> @@ -690,7 +691,7 @@ netxen_flash_erase_sections(struct netxen_adapter
> *adapter, int start, int end) int i;
>
> for (i = start; i < end; i++) {
> - ret = netxen_rom_se(adapter, i * FLASH_SECTOR_SIZE);
> + ret = netxen_rom_se(adapter, i * NETXEN_FLASH_SECTOR_SIZE);
> if (ret)
> break;
> ret = netxen_rom_wip_poll(adapter);
> @@ -707,8 +708,8 @@ netxen_flash_erase_secondary(struct netxen_adapter
> *adapter) int ret = FLASH_SUCCESS;
> int start, end;
>
> - start = SECONDARY_START / FLASH_SECTOR_SIZE;
> - end = USER_START / FLASH_SECTOR_SIZE;
> + start = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE;
> + end = NETXEN_USER_START / NETXEN_FLASH_SECTOR_SIZE;
> ret = netxen_flash_erase_sections(adapter, start, end);
>
> return ret;
> @@ -720,8 +721,8 @@ netxen_flash_erase_primary(struct netxen_adapter
> *adapter) int ret = FLASH_SUCCESS;
> int start, end;
>
> - start = PRIMARY_START / FLASH_SECTOR_SIZE;
> - end = SECONDARY_START / FLASH_SECTOR_SIZE;
> + start = NETXEN_PRIMARY_START / NETXEN_FLASH_SECTOR_SIZE;
> + end = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE;
> ret = netxen_flash_erase_sections(adapter, start, end);
>
> return ret;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] NetXen: Add NETXEN prefix to macros
2007-06-03 15:50 ` Jeff Garzik
2007-06-04 18:58 ` Andy Gospodarek
@ 2007-06-06 17:52 ` wendy xiong
2007-06-06 18:05 ` Jeff Garzik
1 sibling, 1 reply; 7+ messages in thread
From: wendy xiong @ 2007-06-06 17:52 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Mithlesh Thukral, netdev, amitkale, netxenproj, rob
On Sun, 2007-06-03 at 11:50 -0400, Jeff Garzik wrote:
> Mithlesh Thukral wrote:
> > NetXen: Add NETXEN prefix to a macro
> > This patch will add the "NETXEN" prefix to "USER_START" macro.
> >
> > Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
> > Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
> > ---
> >
> > drivers/net/netxen/netxen_nic.h | 4 ++--
> > drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
> > drivers/net/netxen/netxen_nic_hw.c | 4 ++--
> > drivers/net/netxen/netxen_nic_init.c | 4 ++--
> > 4 files changed, 7 insertions(+), 7 deletions(-)
>
> Your patch description is useless. Clearly we know -what- it does,
> simply by reading the patch.
>
> But it does not answer the simple question: why? why is this needed in
> a bug fix Release Candidate series?
Hi Jeff,
When we backported netxen driver to 2.6.9 kernel on ppc, we saw the
compile errors for "USER_START". Because there is another definition for
USER_START which is used by arch/ppc64/mm/hash_utils.c and native.c.
So we like to add NETXEN before USER_START in netxen device driver, then
netxen driver can be compiled correctly in 2.6.9 kernel.
Let me know if you any question for this patch.
Thanks,
wendy Xiong
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] NetXen: Add NETXEN prefix to macros
2007-06-06 17:52 ` wendy xiong
@ 2007-06-06 18:05 ` Jeff Garzik
2007-06-06 18:33 ` wendy xiong
0 siblings, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2007-06-06 18:05 UTC (permalink / raw)
To: wendy xiong; +Cc: Mithlesh Thukral, netdev, amitkale, netxenproj, rob
On Wed, Jun 06, 2007 at 12:52:44PM -0500, wendy xiong wrote:
> On Sun, 2007-06-03 at 11:50 -0400, Jeff Garzik wrote:
> > Mithlesh Thukral wrote:
> > > NetXen: Add NETXEN prefix to a macro
> > > This patch will add the "NETXEN" prefix to "USER_START" macro.
> > >
> > > Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
> > > Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
> > > ---
> > >
> > > drivers/net/netxen/netxen_nic.h | 4 ++--
> > > drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
> > > drivers/net/netxen/netxen_nic_hw.c | 4 ++--
> > > drivers/net/netxen/netxen_nic_init.c | 4 ++--
> > > 4 files changed, 7 insertions(+), 7 deletions(-)
> >
> > Your patch description is useless. Clearly we know -what- it does,
> > simply by reading the patch.
> >
> > But it does not answer the simple question: why? why is this needed in
> > a bug fix Release Candidate series?
>
> Hi Jeff,
>
> When we backported netxen driver to 2.6.9 kernel on ppc, we saw the
> compile errors for "USER_START". Because there is another definition for
> USER_START which is used by arch/ppc64/mm/hash_utils.c and native.c.
>
> So we like to add NETXEN before USER_START in netxen device driver, then
> netxen driver can be compiled correctly in 2.6.9 kernel.
>
> Let me know if you any question for this patch.
That answers my questions, but doesn't address the issue: You need
to regenerate the patch with the description improved as described.
The patch description is copied verbatim into the kernel changelog, and
preserved verbatim for all eternity. Four years from now, we need to be
able to read the patch description and understand -why- the NETXEN_xxx
prefix was added. Simply stating that the NETXEN_xxx prefix was added
is useless, as it is self-evident from reading the patch itself.
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] NetXen: Add NETXEN prefix to macros
2007-06-06 18:05 ` Jeff Garzik
@ 2007-06-06 18:33 ` wendy xiong
0 siblings, 0 replies; 7+ messages in thread
From: wendy xiong @ 2007-06-06 18:33 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Mithlesh Thukral, netdev, amitkale, netxenproj, rob
On Wed, 2007-06-06 at 14:05 -0400, Jeff Garzik wrote:
> On Wed, Jun 06, 2007 at 12:52:44PM -0500, wendy xiong wrote:
> > On Sun, 2007-06-03 at 11:50 -0400, Jeff Garzik wrote:
> > > Mithlesh Thukral wrote:
> > > > NetXen: Add NETXEN prefix to a macro
> > > > This patch will add the "NETXEN" prefix to "USER_START" macro.
> > > >
> > > > Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
> > > > Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
> > > > ---
> > > >
> > > > drivers/net/netxen/netxen_nic.h | 4 ++--
> > > > drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
> > > > drivers/net/netxen/netxen_nic_hw.c | 4 ++--
> > > > drivers/net/netxen/netxen_nic_init.c | 4 ++--
> > > > 4 files changed, 7 insertions(+), 7 deletions(-)
> > >
> > > Your patch description is useless. Clearly we know -what- it does,
> > > simply by reading the patch.
> > >
> > > But it does not answer the simple question: why? why is this needed in
> > > a bug fix Release Candidate series?
> >
> > Hi Jeff,
> >
> > When we backported netxen driver to 2.6.9 kernel on ppc, we saw the
> > compile errors for "USER_START". Because there is another definition for
> > USER_START which is used by arch/ppc64/mm/hash_utils.c and native.c.
> >
> > So we like to add NETXEN before USER_START in netxen device driver, then
> > netxen driver can be compiled correctly in 2.6.9 kernel.
> >
> > Let me know if you any question for this patch.
>
> That answers my questions, but doesn't address the issue: You need
> to regenerate the patch with the description improved as described.
>
> The patch description is copied verbatim into the kernel changelog, and
> preserved verbatim for all eternity. Four years from now, we need to be
> able to read the patch description and understand -why- the NETXEN_xxx
> prefix was added. Simply stating that the NETXEN_xxx prefix was added
> is useless, as it is self-evident from reading the patch itself.
>
> Jeff
>
>
>
Jeff,
Thanks.
We will re-generate the patch with correct issue title and description.
Thanks,
wendy
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-06-06 18:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-01 11:15 [PATCH 3/5] NetXen: Add NETXEN prefix to macros Mithlesh Thukral
2007-06-03 15:50 ` Jeff Garzik
2007-06-04 18:58 ` Andy Gospodarek
2007-06-06 11:07 ` Mithlesh Thukral
2007-06-06 17:52 ` wendy xiong
2007-06-06 18:05 ` Jeff Garzik
2007-06-06 18:33 ` wendy xiong
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).