From: Jeff Garzik <jeff@garzik.org>
To: "Linsys Contractor Amit S. Kale" <amitkale@unminc.com>
Cc: netdev@vger.kernel.org, sanjeev@netxen.com,
unmproj@linsyssoft.com, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 2.6.17 3/9] NetXen: Registers info header file.
Date: Wed, 05 Jul 2006 11:51:48 -0400 [thread overview]
Message-ID: <44ABE014.6010407@garzik.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0607050629100.27969@dut46>
Linsys Contractor Amit S. Kale wrote:
=> +extern struct netxen_adapter *g_adapter;
> +
> +/*
> + * The basic unit of access when reading/writing control registers.
> + */
> +
> +typedef u32 netxen_crbword_t; /* single word in CRB space */
> +
> +#define NETXEN_HW_H0_CH_HUB_ADR 0x05
> +#define NETXEN_HW_H1_CH_HUB_ADR 0x0E
> +#define NETXEN_HW_H2_CH_HUB_ADR 0x03
> +#define NETXEN_HW_H3_CH_HUB_ADR 0x01
> +#define NETXEN_HW_H4_CH_HUB_ADR 0x06
> +#define NETXEN_HW_H5_CH_HUB_ADR 0x07
> +#define NETXEN_HW_H6_CH_HUB_ADR 0x08
> +
> +/* Hub 0 */
> +#define NETXEN_HW_MN_CRB_AGT_ADR 0x15
> +#define NETXEN_HW_MS_CRB_AGT_ADR 0x25
> +
> +/* Hub 1 */
> +#define NETXEN_HW_PS_CRB_AGT_ADR 0x73
> +#define NETXEN_HW_SS_CRB_AGT_ADR 0x20
> +#define NETXEN_HW_RPMX3_CRB_AGT_ADR 0x0b
> +#define NETXEN_HW_QMS_CRB_AGT_ADR 0x00
> +#define NETXEN_HW_SQGS0_CRB_AGT_ADR 0x01
> +#define NETXEN_HW_SQGS1_CRB_AGT_ADR 0x02
> +#define NETXEN_HW_SQGS2_CRB_AGT_ADR 0x03
> +#define NETXEN_HW_SQGS3_CRB_AGT_ADR 0x04
> +#define NETXEN_HW_C2C0_CRB_AGT_ADR 0x58
> +#define NETXEN_HW_C2C1_CRB_AGT_ADR 0x59
> +#define NETXEN_HW_C2C2_CRB_AGT_ADR 0x5a
> +#define NETXEN_HW_RPMX2_CRB_AGT_ADR 0x0a
> +#define NETXEN_HW_RPMX4_CRB_AGT_ADR 0x0c
> +#define NETXEN_HW_RPMX7_CRB_AGT_ADR 0x0f
> +#define NETXEN_HW_RPMX9_CRB_AGT_ADR 0x12
> +#define NETXEN_HW_SMB_CRB_AGT_ADR 0x18
overall, enums are preferred over #define. It provides type info to the
compiler, provides symbol info to debuggers and similar tools, and other
benefits.
e.g.
enum {
NETXEN_HW_RPMX9_CRB_AGT_ADR = 0x12,
NETXEN_HW_SMB_CRB_AGT_ADR = 0x18,
};
> +#define NETXEN_PCI_MAPSIZE 128
> +#define NETXEN_PCI_DDR_NET (unsigned long)0x00000000
> +#define NETXEN_PCI_QDR_NET (unsigned long)0x04000000
> +#define NETXEN_PCI_DIRECT_CRB (unsigned long)0x04400000
> +#define NETXEN_PCI_CAMQM_MAX (unsigned long)0x04ffffff
> +#define NETXEN_PCI_OCM0 (unsigned long)0x05000000
> +#define NETXEN_PCI_OCM0_MAX (unsigned long)0x050fffff
> +#define NETXEN_PCI_OCM1 (unsigned long)0x05100000
> +#define NETXEN_PCI_OCM1_MAX (unsigned long)0x051fffff
> +#define NETXEN_PCI_CRBSPACE (unsigned long)0x06000000
Use the 'UL' suffix, not a cast
> +struct netxen_pcix_crb_window {
> + netxen_crbword_t rsvd1:25, addrbit:1, /* bit 25 of CRB address */
> + rsvd2:6;
> +};
see bitfields objections in another email
next prev parent reply other threads:[~2006-07-05 15:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-05 13:15 [PATCH 2.6.17 0/9] NetXen: ethernet nic driver Linsys Contractor Amit S. Kale
2006-07-05 13:20 ` [PATCH 2.6.17 1/9] NetXen: Makefile and ethtool interface Linsys Contractor Amit S. Kale
2006-07-05 15:34 ` Jeff Garzik
2006-07-06 13:50 ` Pradeep Dalvi
2006-07-05 13:29 ` [PATCH 2.6.17 2/9] NetXen: Main header file Linsys Contractor Amit S. Kale
2006-07-05 15:46 ` Jeff Garzik
2006-07-05 13:31 ` [PATCH 2.6.17 3/9] NetXen: Registers info " Linsys Contractor Amit S. Kale
2006-07-05 15:51 ` Jeff Garzik [this message]
2006-07-05 13:34 ` [PATCH 2.6.17 4/9] NetXen: hardware access routines Linsys Contractor Amit S. Kale
2006-07-05 16:00 ` Jeff Garzik
2006-07-05 13:38 ` [PATCH 2.6.17 5/9] NetXen: hardware access header file Linsys Contractor Amit S. Kale
2006-07-05 16:04 ` Jeff Garzik
2006-07-05 13:40 ` [PATCH 2.6.17 6/9] NetXen: hw initialization routines Linsys Contractor Amit S. Kale
2006-07-05 16:12 ` Jeff Garzik
2006-07-05 13:42 ` [PATCH 2.6.17 7/9] NetXen: ioctl interface and intr routines Linsys Contractor Amit S. Kale
2006-07-05 13:44 ` [PATCH 2.6.17 8/9] NetXen: Driver main file Linsys Contractor Amit S. Kale
2006-07-05 13:47 ` [PATCH 2.6.17 9/9] NetXen: niu handling and CRB reg definitions Linsys Contractor Amit S. Kale
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44ABE014.6010407@garzik.org \
--to=jeff@garzik.org \
--cc=akpm@osdl.org \
--cc=amitkale@unminc.com \
--cc=netdev@vger.kernel.org \
--cc=sanjeev@netxen.com \
--cc=unmproj@linsyssoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.