Search Linux Wireless

Re: SSB AI support code ([RFC4/11] SSB core control and state device ops)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



W dniu 9 lutego 2011 21:35 uÅytkownik RafaÅ MiÅecki <zajec5@xxxxxxxxx> napisaÅ:
> 2011/2/9 George Kashperko <george@xxxxxxxxxxx>:
>> From: George Kashperko <george@xxxxxxxxxxx>
>>
>> Introduce handlers for SB core control and state flags' management. SB-style
>> buses provide access to these flags at two high octets of TMSLOW and TMSHIGH
>> registers whereas AI-ones implement these flags in two low octets of IOCTRL
>> and IOSTAT registers.
>> Signed-off-by: George Kashperko <george@xxxxxxxxxxx>
>> ---
>> Âdrivers/ssb/main.c   Â|  36 ++++++++++++++++++++++++++++++++++++
>> Âinclude/linux/ssb/ssb.h | Â 14 +++++++++++++-
>> Â2 files changed, 49 insertions(+), 1 deletion(-)
>> --- linux-next-20110203.orig/drivers/ssb/main.c 2011-02-07 16:58:50.000000000 +0200
>> +++ linux-next-20110203/drivers/ssb/main.c   Â2011-02-07 17:07:11.000000000 +0200
>> @@ -1350,6 +1350,40 @@ static u32 ssb_admatch_size_sb(struct ss
>> Â Â Â Âreturn size;
>> Â}
>>
>> +static void ssb_core_ctl_flags_sb(struct ssb_device *dev, u32 mask,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â u32 val, u32 *res)
>> +{
>> + Â Â Â u32 tmp;
>> +
>> + Â Â Â if (mask || val) {
>> + Â Â Â Â Â Â Â tmp = (ssb_read32(dev, SSB_TMSLOW) & ~mask) | val;
>> + Â Â Â Â Â Â Â ssb_write32(dev, SSB_TMSLOW, tmp);
>> + Â Â Â }
>
> Are you going to use that function for just reading SSB_TMSLOW? Why
> won't you use separated function then? Do you need separated function
> for sth so simple as "ssb_read32(dev, SSB_TMSLOW);" at all?

In b43 we used to implement mask other way:

void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set)
{
	b43_radio_write16(dev, offset,
			  (b43_radio_read16(dev, offset) & mask) | set);
}

I don't vote for any option, but I think we should one method everywhere.
(mask vs. ~mask)

-- 
RafaÅ
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux