Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1422406
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 net-next v2 11/12] net: dsa: mv88e6xxx: add an SMI ops structure |
| Date | 2016-06-15 00:30 +0200 |
| Message-ID | <rK50m-2si-25@gated-at.bofh.it> (permalink) |
| References | <rK1pL-88-3@gated-at.bofh.it> <rK1pL-88-1@gated-at.bofh.it> <rK4GZ-2lJ-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Andrew,
Andrew Lunn <andrew@lunn.ch> writes:
>> +struct mv88e6xxx_smi_ops {
>> + int (*read)(struct mii_bus *bus, int sw_addr,
>> + int addr, int reg, u16 *val);
>> + int (*write)(struct mii_bus *bus, int sw_addr,
>> + int addr, int reg, u16 val);
>> +};
>> +
>
> I think this API would be better if it used ps, not bus and sw_addr.
>
> The only problem is the very first read to get the switch ID. I would
> add one more layer in between, so that you can call the lowest level
> functions without having a ps structure.
That's why I keep it simple for the moment.
The low-level API using ps is now _mv88e6xxx_reg_{read,write}. I can
rename them to mv88e6xxx_smi_{read,write} in v3 or later.
Thanks,
Vivien
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 net-next v2 11/12] net: dsa: mv88e6xxx: add an SMI ops structure Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-14 20:40 +0200
Re: [PATCH v2 net-next v2 11/12] net: dsa: mv88e6xxx: add an SMI ops structure Andrew Lunn <andrew@lunn.ch> - 2016-06-15 00:10 +0200
Re: [PATCH v2 net-next v2 11/12] net: dsa: mv88e6xxx: add an SMI ops structure Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-15 00:30 +0200
csiph-web