Skip to contentSkip to conversation

DISCUSSION Milton Miller 4 participants 5 messages Apr 12, 2007 – Apr 13, 2007

lore
Share & tools
lore
#0 lore raw

Matt sealey wrote:

+ if (cb & 0x5) { /* if controller is configured for pci-native mode for both channels */

The above expression allows 1, 4, or 5 for the masked bits. I'm guessing you wanted to test that equal to either 5 or 0.

milton

#1 lore raw
Quoted 8 lines · Milton Miller

Matt sealey wrote:

+ if (cb & 0x5) { /* if controller is configured for
pci-native mode for both channels */

The above expression allows 1, 4, or 5 for the masked bits. I'm guessing you
wanted to test that equal to either 5 or 0.

I think the proper test is ((cb & 5) == 5) but I can't remember for sure..

Ben.

#2 lore raw
Quoted 9 lines
Quoted 6 lines

+ if (cb & 0x5) { /* if controller is configured for
pci-native mode for both channels */

The above expression allows 1, 4, or 5 for the masked bits. I'm guessing you
wanted to test that equal to either 5 or 0.

I think the proper test is ((cb & 5) == 5) but I can't remember for sure..

That is correct if you know for sure the controller actually supports native mode, and doesn't have that support turned off by some configuration setting; otherwise, the test should be ((cb & 0xf) == 0xf).

Segher

#3 lore raw

Hello.

Quoted 7 lines · Segher Boessenkool
Quoted 6 lines
Quoted 6 lines

+ if (cb & 0x5) { /* if controller is configured for
pci-native mode for both channels */

The above expression allows 1, 4, or 5 for the masked bits. I'm guessing you
wanted to test that equal to either 5 or 0.

Quoted 7 lines
Quoted 2 lines

I think the proper test is ((cb & 5) == 5) but I can't remember for sure..

That is correct if you know for sure the controller actually supports native mode, and doesn't have that support turned off by some configuration setting; otherwise, the test should be ((cb & 0xf) == 0xf).

"I protest your honor". :-)
Bits 1 and 3 only indicate that bits 0 and 2 are writeable.

MBR, Sergei

#4 lore raw
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

I think the proper test is ((cb & 5) == 5) but I can't remember for sure..

That is correct if you know for sure the controller actually supports native mode, and doesn't have that support turned off by some configuration setting; otherwise, the test should be ((cb & 0xf) == 0xf).

"I protest your honor". :-)
Bits 1 and 3 only indicate that bits 0 and 2 are writeable.

Darn you're right. Sorry for the confusion.

Segher