* question about drivers/net/tg3.c
@ 2009-07-29 15:49 Julia Lawall
2009-07-29 16:39 ` Matt Carlson
0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2009-07-29 15:49 UTC (permalink / raw)
To: mcarlson, mchan, netdev
The function tg3_reset_hw in the file drivers/net/tg3.c contains the code:
/* If statement applies to 5705 and 5750 PCI devices only */
if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
(tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
/* nothing */
} else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
!(tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
val |= WDMAC_MODE_RX_ACCEL;
}
}
On the fifth line above there is the code:
tp->tg3_flags & TG3_FLG2_TSO_CAPABLE
but the tg3_flags field seems to normally have a value whose name contains
FLAG, and not FLG2. Should this code be:
tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
or should the constant be different?
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: question about drivers/net/tg3.c
2009-07-29 15:49 question about drivers/net/tg3.c Julia Lawall
@ 2009-07-29 16:39 ` Matt Carlson
2009-07-29 16:50 ` Matt Carlson
2009-07-29 16:58 ` Julia Lawall
0 siblings, 2 replies; 5+ messages in thread
From: Matt Carlson @ 2009-07-29 16:39 UTC (permalink / raw)
To: Julia Lawall; +Cc: Matthew Carlson, Michael Chan, netdev@vger.kernel.org
On Wed, Jul 29, 2009 at 08:49:35AM -0700, Julia Lawall wrote:
> The function tg3_reset_hw in the file drivers/net/tg3.c contains the code:
>
> /* If statement applies to 5705 and 5750 PCI devices only */
> if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
> tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
> GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
> if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
> (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
> tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
> /* nothing */
> } else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
> !(tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
> !(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
> val |= WDMAC_MODE_RX_ACCEL;
> }
> }
>
>
> On the fifth line above there is the code:
>
> tp->tg3_flags & TG3_FLG2_TSO_CAPABLE
>
> but the tg3_flags field seems to normally have a value whose name contains
> FLAG, and not FLG2. Should this code be:
>
> tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
>
> or should the constant be different?
On all the copies of tg3.c I have readily available, the line says :
tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
Even the latest net-next tree is like this. Where did you get your
source from?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: question about drivers/net/tg3.c
2009-07-29 16:39 ` Matt Carlson
@ 2009-07-29 16:50 ` Matt Carlson
2009-07-29 16:58 ` Julia Lawall
1 sibling, 0 replies; 5+ messages in thread
From: Matt Carlson @ 2009-07-29 16:50 UTC (permalink / raw)
To: Matt Carlson; +Cc: Julia Lawall, Michael Chan, netdev@vger.kernel.org
On Wed, Jul 29, 2009 at 09:39:43AM -0700, Matt Carlson wrote:
> On Wed, Jul 29, 2009 at 08:49:35AM -0700, Julia Lawall wrote:
> > The function tg3_reset_hw in the file drivers/net/tg3.c contains the code:
> >
> > /* If statement applies to 5705 and 5750 PCI devices only */
> > if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
> > tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
> > GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
> > if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
> > (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
> > tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
> > /* nothing */
> > } else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
> > !(tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
> > !(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
> > val |= WDMAC_MODE_RX_ACCEL;
> > }
> > }
> >
> >
> > On the fifth line above there is the code:
> >
> > tp->tg3_flags & TG3_FLG2_TSO_CAPABLE
> >
> > but the tg3_flags field seems to normally have a value whose name contains
> > FLAG, and not FLG2. Should this code be:
> >
> > tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
> >
> > or should the constant be different?
>
> On all the copies of tg3.c I have readily available, the line says :
>
> tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
>
> Even the latest net-next tree is like this. Where did you get your
> source from?
Never mind that. I did a search for the "If statement applies..." string
and didn't expect to have it match twice. You are right. The comparison
should be against tp->tg3_flags2. I'll integrate that fix into a
patchset I'm preparing as we speak.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: question about drivers/net/tg3.c
2009-07-29 16:39 ` Matt Carlson
2009-07-29 16:50 ` Matt Carlson
@ 2009-07-29 16:58 ` Julia Lawall
2009-07-29 16:59 ` Julia Lawall
1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2009-07-29 16:58 UTC (permalink / raw)
To: Matt Carlson; +Cc: Michael Chan, netdev@vger.kernel.org
On Wed, 29 Jul 2009, Matt Carlson wrote:
> On Wed, Jul 29, 2009 at 08:49:35AM -0700, Julia Lawall wrote:
> > The function tg3_reset_hw in the file drivers/net/tg3.c contains the code:
> >
> > /* If statement applies to 5705 and 5750 PCI devices only */
> > if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
> > tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
> > GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
> > if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
> > (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
> > tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
> > /* nothing */
> > } else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
> > !(tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
> > !(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
> > val |= WDMAC_MODE_RX_ACCEL;
> > }
> > }
> >
> >
> > On the fifth line above there is the code:
> >
> > tp->tg3_flags & TG3_FLG2_TSO_CAPABLE
> >
> > but the tg3_flags field seems to normally have a value whose name contains
> > FLAG, and not FLG2. Should this code be:
> >
> > tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
> >
> > or should the constant be different?
>
> On all the copies of tg3.c I have readily available, the line says :
>
> tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
>
> Even the latest net-next tree is like this. Where did you get your
> source from?
linux-next
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: question about drivers/net/tg3.c
2009-07-29 16:58 ` Julia Lawall
@ 2009-07-29 16:59 ` Julia Lawall
0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2009-07-29 16:59 UTC (permalink / raw)
To: Matt Carlson; +Cc: Michael Chan, netdev@vger.kernel.org
On Wed, 29 Jul 2009, Julia Lawall wrote:
> On Wed, 29 Jul 2009, Matt Carlson wrote:
>
> > On Wed, Jul 29, 2009 at 08:49:35AM -0700, Julia Lawall wrote:
> > > The function tg3_reset_hw in the file drivers/net/tg3.c contains the code:
> > >
> > > /* If statement applies to 5705 and 5750 PCI devices only */
> > > if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
> > > tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
> > > GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
> > > if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
> > > (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
> > > tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
> > > /* nothing */
> > > } else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
> > > !(tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
> > > !(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
> > > val |= WDMAC_MODE_RX_ACCEL;
> > > }
> > > }
> > >
> > >
> > > On the fifth line above there is the code:
> > >
> > > tp->tg3_flags & TG3_FLG2_TSO_CAPABLE
> > >
> > > but the tg3_flags field seems to normally have a value whose name contains
> > > FLAG, and not FLG2. Should this code be:
> > >
> > > tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
> > >
> > > or should the constant be different?
> >
> > On all the copies of tg3.c I have readily available, the line says :
> >
> > tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE
> >
> > Even the latest net-next tree is like this. Where did you get your
> > source from?
>
> linux-next
>From Friday, so perhaps it is out of date already.
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-07-29 17:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 15:49 question about drivers/net/tg3.c Julia Lawall
2009-07-29 16:39 ` Matt Carlson
2009-07-29 16:50 ` Matt Carlson
2009-07-29 16:58 ` Julia Lawall
2009-07-29 16:59 ` Julia Lawall
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).