* [PATCH 04/26] rt2x00: EEPROM 93Cx6
@ 2006-12-03 18:19 Ivo van Doorn
2006-12-03 18:39 ` Michael Wu
0 siblings, 1 reply; 10+ messages in thread
From: Ivo van Doorn @ 2006-12-03 18:19 UTC (permalink / raw)
To: John W. Linville; +Cc: netdev
rt2400pci, rt2500pci and rt61pci share exactly the
same code for the eeprom reading. The only difference
is that rt61pci has a slightly different register reading
approach. In any case we have a lot of duplicate code.
Create a new module eeprom_93cx6 inside the rt2x00 folder
and make rt2x00 use that.
As a bonus the entire eeprom is read into an array
to optimize eeprom usage. This also enables dummy eeprom
writing where the temporary buffer can be manipulated by
the user without permanently harming the eeprom.
This feature should have been enabled through ethtool,
but 3 days after this patch ethtool was removed from
d80211. This feature will be used when debugfs has been
implemented.
Signed-off-by Ivo van Doorn <IvDoorn@gmail.com>
---
http://www.mendiosus.nl/rt2x00/04_eeprom.diff
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-03 18:19 [PATCH 04/26] rt2x00: EEPROM 93Cx6 Ivo van Doorn
@ 2006-12-03 18:39 ` Michael Wu
2006-12-03 18:45 ` Ivo van Doorn
2006-12-08 18:56 ` Ivo van Doorn
0 siblings, 2 replies; 10+ messages in thread
From: Michael Wu @ 2006-12-03 18:39 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, netdev
[-- Attachment #1: Type: text/plain, Size: 655 bytes --]
On Sunday 03 December 2006 13:19, Ivo van Doorn wrote:
> rt2400pci, rt2500pci and rt61pci share exactly the
> same code for the eeprom reading. The only difference
> is that rt61pci has a slightly different register reading
> approach. In any case we have a lot of duplicate code.
> Create a new module eeprom_93cx6 inside the rt2x00 folder
> and make rt2x00 use that.
Interesting. adm8211 has code to read 93C66 and 93C46 eeproms, and it looks
similar, albeit smaller and simpler, to your 93cx6 reading code. However, it
looks like your new eeprom reading code is general enough for adm8211 to use
too. I'll have to try it..
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-03 18:39 ` Michael Wu
@ 2006-12-03 18:45 ` Ivo van Doorn
2006-12-08 18:56 ` Ivo van Doorn
1 sibling, 0 replies; 10+ messages in thread
From: Ivo van Doorn @ 2006-12-03 18:45 UTC (permalink / raw)
To: Michael Wu; +Cc: John W. Linville, netdev
On Sunday 03 December 2006 19:39, Michael Wu wrote:
> On Sunday 03 December 2006 13:19, Ivo van Doorn wrote:
> > rt2400pci, rt2500pci and rt61pci share exactly the
> > same code for the eeprom reading. The only difference
> > is that rt61pci has a slightly different register reading
> > approach. In any case we have a lot of duplicate code.
> > Create a new module eeprom_93cx6 inside the rt2x00 folder
> > and make rt2x00 use that.
> Interesting. adm8211 has code to read 93C66 and 93C46 eeproms, and it looks
> similar, albeit smaller and simpler, to your 93cx6 reading code. However, it
> looks like your new eeprom reading code is general enough for adm8211 to use
> too. I'll have to try it..
Good to hear, I'll check it out as well.
If they are indeed similar the eeprom_93cx6 could be moved to a more general
location as well so the module can be shared. :)
Ivo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-03 18:39 ` Michael Wu
2006-12-03 18:45 ` Ivo van Doorn
@ 2006-12-08 18:56 ` Ivo van Doorn
2006-12-09 2:00 ` Michael Wu
1 sibling, 1 reply; 10+ messages in thread
From: Ivo van Doorn @ 2006-12-08 18:56 UTC (permalink / raw)
To: Michael Wu; +Cc: John W. Linville, netdev
On Sunday 03 December 2006 19:39, Michael Wu wrote:
> On Sunday 03 December 2006 13:19, Ivo van Doorn wrote:
> > rt2400pci, rt2500pci and rt61pci share exactly the
> > same code for the eeprom reading. The only difference
> > is that rt61pci has a slightly different register reading
> > approach. In any case we have a lot of duplicate code.
> > Create a new module eeprom_93cx6 inside the rt2x00 folder
> > and make rt2x00 use that.
> Interesting. adm8211 has code to read 93C66 and 93C46 eeproms, and it looks
> similar, albeit smaller and simpler, to your 93cx6 reading code. However, it
> looks like your new eeprom reading code is general enough for adm8211 to use
> too. I'll have to try it..
I have checked the adm80211 code as well, it seems to behave quite the same,
with the most notable difference the fact that adm80211 writes the READ_OPCODE
and the word index within a single command, while in eeprom_93cx6 this is
split into 2 seperate write commands.
I have not yet tested the exact impact for rt2x00 devices when they would combine
the write commands, but if that has no impact (or the adm80211 suffers no impact
when the write commands are being split) then rt2x00 and adm80211 could indeed
share the eeprom_93cx6 module.
If eeprom_93cx6 is moved to the /lib folder of the kernel, should it be approved by
a different maintainer first?
Ivo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-08 18:56 ` Ivo van Doorn
@ 2006-12-09 2:00 ` Michael Wu
2006-12-09 13:05 ` Ivo Van Doorn
0 siblings, 1 reply; 10+ messages in thread
From: Michael Wu @ 2006-12-09 2:00 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, netdev
[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]
On Friday 08 December 2006 13:56, Ivo van Doorn wrote:
> I have checked the adm80211 code as well, it seems to behave quite the
> same, with the most notable difference the fact that adm80211 writes the
> READ_OPCODE and the word index within a single command, while in
> eeprom_93cx6 this is split into 2 seperate write commands.
> I have not yet tested the exact impact for rt2x00 devices when they would
> combine the write commands, but if that has no impact (or the adm80211
> suffers no impact when the write commands are being split) then rt2x00 and
> adm80211 could indeed share the eeprom_93cx6 module.
Hm, which way is the correct way? (is there a correct way?)
> If eeprom_93cx6 is moved to the /lib folder of the kernel, should it be
> approved by a different maintainer first?
>
I don't think so, but I'm not sure. BTW, I think there can actually be another
user of this code. Take a look at drivers/scsi/aic7xxx/aic7xxx_93cx6.c
I'm not sure who the maintainer for this is. Should be okay to just have
adm8211 and rt2x00 using eeprom_93cx6 for now, unless you have a spare
aic7xxx supported device lying around. ;)
Thanks,
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-09 2:00 ` Michael Wu
@ 2006-12-09 13:05 ` Ivo Van Doorn
2006-12-13 15:44 ` Lennart Sorensen
0 siblings, 1 reply; 10+ messages in thread
From: Ivo Van Doorn @ 2006-12-09 13:05 UTC (permalink / raw)
To: Michael Wu; +Cc: John W. Linville, netdev
Hi
> > I have checked the adm80211 code as well, it seems to behave quite the
> > same, with the most notable difference the fact that adm80211 writes the
> > READ_OPCODE and the word index within a single command, while in
> > eeprom_93cx6 this is split into 2 seperate write commands.
> > I have not yet tested the exact impact for rt2x00 devices when they would
> > combine the write commands, but if that has no impact (or the adm80211
> > suffers no impact when the write commands are being split) then rt2x00 and
> > adm80211 could indeed share the eeprom_93cx6 module.
> Hm, which way is the correct way? (is there a correct way?)
I have tested rt2x00 with combining the read command and word index writing,
and it is working perfectly.
> > If eeprom_93cx6 is moved to the /lib folder of the kernel, should it be
> > approved by a different maintainer first?
> >
> I don't think so, but I'm not sure. BTW, I think there can actually be
> another
> user of this code. Take a look at drivers/scsi/aic7xxx/aic7xxx_93cx6.c
>
> I'm not sure who the maintainer for this is. Should be okay to just have
> adm8211 and rt2x00 using eeprom_93cx6 for now, unless you have a spare
> aic7xxx supported device lying around. ;)
Nope, don't have that device. I'll create a patch that will place the eeprom
module in the /lib folder. I'll send that to the list as soon as possible.
Ivo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-09 13:05 ` Ivo Van Doorn
@ 2006-12-13 15:44 ` Lennart Sorensen
2006-12-13 16:47 ` Ivo van Doorn
0 siblings, 1 reply; 10+ messages in thread
From: Lennart Sorensen @ 2006-12-13 15:44 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: Michael Wu, John W. Linville, netdev
On Sat, Dec 09, 2006 at 02:05:06PM +0100, Ivo Van Doorn wrote:
> Nope, don't have that device. I'll create a patch that will place the eeprom
> module in the /lib folder. I'll send that to the list as soon as possible.
Hmm, I wonder if this will be of help for me trying to read/write a
93c46 connected to an exar uart (jsm driver). So far I was trying to
bit bang the IO from user space through the PCI registers, but having a
proper support in the driver would probably work better (so far I didn't
get it to work although I haven't tried very hard yet).
--
Len Sorensen
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-13 15:44 ` Lennart Sorensen
@ 2006-12-13 16:47 ` Ivo van Doorn
2006-12-13 17:05 ` Lennart Sorensen
0 siblings, 1 reply; 10+ messages in thread
From: Ivo van Doorn @ 2006-12-13 16:47 UTC (permalink / raw)
To: Lennart Sorensen; +Cc: Michael Wu, John W. Linville, netdev
On Wednesday 13 December 2006 16:44, Lennart Sorensen wrote:
> On Sat, Dec 09, 2006 at 02:05:06PM +0100, Ivo Van Doorn wrote:
> > Nope, don't have that device. I'll create a patch that will place the eeprom
> > module in the /lib folder. I'll send that to the list as soon as possible.
>
> Hmm, I wonder if this will be of help for me trying to read/write a
> 93c46 connected to an exar uart (jsm driver). So far I was trying to
> bit bang the IO from user space through the PCI registers, but having a
> proper support in the driver would probably work better (so far I didn't
> get it to work although I haven't tried very hard yet).
Do you need to actually write data to the eeprom chip?
Currently the module does not support writing to the eeprom,
this is something I could add (The original Ralink code, where this module
is based on also contains the code to write to the EEPROM).
Ivo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-13 16:47 ` Ivo van Doorn
@ 2006-12-13 17:05 ` Lennart Sorensen
2006-12-13 17:17 ` Ivo van Doorn
0 siblings, 1 reply; 10+ messages in thread
From: Lennart Sorensen @ 2006-12-13 17:05 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: Michael Wu, John W. Linville, netdev
On Wed, Dec 13, 2006 at 05:47:41PM +0100, Ivo van Doorn wrote:
> Do you need to actually write data to the eeprom chip?
> Currently the module does not support writing to the eeprom,
> this is something I could add (The original Ralink code, where this module
> is based on also contains the code to write to the EEPROM).
I am going to use it to write the custom pci vendor ID to the eeprom, so
yes I intend to write to it. The code appears as if it has the ability
to write to the eeprom but I didn't look at all of it carefully yet. I
don't actually have any need to read it back, although I intend to do so
to verify the contents.
--
Len Sorensen
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 04/26] rt2x00: EEPROM 93Cx6
2006-12-13 17:05 ` Lennart Sorensen
@ 2006-12-13 17:17 ` Ivo van Doorn
0 siblings, 0 replies; 10+ messages in thread
From: Ivo van Doorn @ 2006-12-13 17:17 UTC (permalink / raw)
To: Lennart Sorensen; +Cc: Michael Wu, John W. Linville, netdev
On Wednesday 13 December 2006 18:05, Lennart Sorensen wrote:
> On Wed, Dec 13, 2006 at 05:47:41PM +0100, Ivo van Doorn wrote:
> > Do you need to actually write data to the eeprom chip?
> > Currently the module does not support writing to the eeprom,
> > this is something I could add (The original Ralink code, where this module
> > is based on also contains the code to write to the EEPROM).
>
> I am going to use it to write the custom pci vendor ID to the eeprom, so
> yes I intend to write to it. The code appears as if it has the ability
> to write to the eeprom but I didn't look at all of it carefully yet. I
> don't actually have any need to read it back, although I intend to do so
> to verify the contents.
Currently the module does not contain any code to actually write to
the eeprom. I'll create a patch to add support for the writing.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-12-13 17:17 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-03 18:19 [PATCH 04/26] rt2x00: EEPROM 93Cx6 Ivo van Doorn
2006-12-03 18:39 ` Michael Wu
2006-12-03 18:45 ` Ivo van Doorn
2006-12-08 18:56 ` Ivo van Doorn
2006-12-09 2:00 ` Michael Wu
2006-12-09 13:05 ` Ivo Van Doorn
2006-12-13 15:44 ` Lennart Sorensen
2006-12-13 16:47 ` Ivo van Doorn
2006-12-13 17:05 ` Lennart Sorensen
2006-12-13 17:17 ` Ivo van Doorn
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).