Re: Documentation for Realtek 8188* devices

2013-11-15 Thread Stefan Sperling
On Thu, Nov 14, 2013 at 05:49:44PM +0100, Dmitrij D. Czarkoff wrote:
 Hello!
 
 I'm strugling to find any documentation for RTL8188* wireless devices
 (including those already supported in urtwn driver). I wrote to Realtek,
 but no responce followed.
 
 My problem is that I have a MiniPCI RTL8188CE device in my ThinkPad, and
 I want to try writing a driver for it. AFAIK RTL8188CE-VAU (supported in
 urtwn) is essencially RTL8188CE with USB bridge, so having access to
 documentation urtwn driver was based on would be very helpful.
 
 So, if anyone knows where these docs can be found, I would be very
 greatful.

I have this device too and would be happy to help out.
Some time ago I started looking into what would be necessary to
make it work.

I don't think there are any docs. The Linux driver is the only
reference I could find.

The linux driver has pci/usb shims around a common core, much like
some other OpenBSD wireless drivers do (e.g. athn(4)).

I believe a good approach would be to write a working PCI device driver
based on our USB one (urtwn(4)), and then factor out common code from
both into the sys/dev/ic/ directory in a separate step.



Re: Documentation for Realtek 8188* devices

2013-11-15 Thread Dmitrij D. Czarkoff
Stefan Sperling said:
 I don't think there are any docs. The Linux driver is the only
 reference I could find.
 
 The linux driver has pci/usb shims around a common core, much like
 some other OpenBSD wireless drivers do (e.g. athn(4)).
 
 I believe a good approach would be to write a working PCI device driver
 based on our USB one (urtwn(4)), and then factor out common code from
 both into the sys/dev/ic/ directory in a separate step.

That was my plan, though I hoped there is some documentation from
Realtek i could use to avoid looking at Linux driver - I'm afraid Linux
people would react badly if their driver is used even as plain
reference, without any code copying.

-- 
Dmitrij D. Czarkoff



Re: Documentation for Realtek 8188* devices

2013-11-15 Thread Tobias Ulmer
On Fri, Nov 15, 2013 at 04:55:23AM +0100, Dmitrij D. Czarkoff wrote:
 Stefan Sperling said:
  I don't think there are any docs. The Linux driver is the only
  reference I could find.
  
  The linux driver has pci/usb shims around a common core, much like
  some other OpenBSD wireless drivers do (e.g. athn(4)).
  
  I believe a good approach would be to write a working PCI device driver
  based on our USB one (urtwn(4)), and then factor out common code from
  both into the sys/dev/ic/ directory in a separate step.
 
 That was my plan, though I hoped there is some documentation from
 Realtek i could use to avoid looking at Linux driver - I'm afraid Linux
 people would react badly if their driver is used even as plain
 reference, without any code copying.

No, this is not how copyright works. What you want to learn from looking
at their code is not the part that is copyrighted, but the facts, like
which registers needs to be set to what value at which time and sequence.

Whoever wrote the driver copied those facts out of a datasheet as well.

 
 -- 
 Dmitrij D. Czarkoff
 



Re: Documentation for Realtek 8188* devices

2013-11-15 Thread Stefan Sperling
On Fri, Nov 15, 2013 at 04:55:23AM +0100, Dmitrij D. Czarkoff wrote:
 That was my plan, though I hoped there is some documentation from
 Realtek i could use to avoid looking at Linux driver - I'm afraid Linux
 people would react badly if their driver is used even as plain
 reference, without any code copying.

Yes, this needs to be done carefully. But it can and has been done.

Keep in mind that there is a difference between copy-pasting code
and between writing new code based on information obtained by
studying another code base. The degree of that difference might
vary between legal systems, and involve questions like whether
patents are involved. But after all, what you're really using is
publicly available *information*, not code.

And some parts of driver code, such as register offsets, are facts,
rather than a creative work, and thus aren't even copyrightable as such.

In this case, I believe you can safely use the Linux driver as a
documentation reference, and use the already working urtwn(4) driver
as a code base to start with.

Personally, and as a matter of principle, I don't think we should
let anyone (such as other open source projects, policy makers, or
companies) scare us away from writing new interoperable code for
our OS and release it under a free licence.
I am not putting up with this bulling shit

While writing rtsx(4) I found that Linux developers employed by Realtek
were trying to be very helpful, within limits imposed by NDAs they had
signed. They actually reviewed my code and found a show-stopper bug.
That's not perfect, because we still don't have docs and depend on
insiders to get information. I asked for data sheets several times,
and those requests were forwarded internally but it looked like their
legal team blocked those requests. But it doesn't hurt to ask. And the
more people ask the more attention will be brought to the problem.



Re: Documentation for Realtek 8188* devices

2013-11-15 Thread Dmitrij D. Czarkoff
Tobias Ulmer said:
 No, this is not how copyright works. What you want to learn from looking
 at their code is not the part that is copyrighted, but the facts, like
 which registers needs to be set to what value at which time and sequence.
 
 Whoever wrote the driver copied those facts out of a datasheet as well.

I'm not worried about copyright - I'm worried about possible drama and
FUD, which inflict due damage regardless of underlying claims' validity.

-- 
Dmitrij D. Czarkoff



Documentation for Realtek 8188* devices

2013-11-14 Thread Dmitrij D. Czarkoff
Hello!

I'm strugling to find any documentation for RTL8188* wireless devices
(including those already supported in urtwn driver). I wrote to Realtek,
but no responce followed.

My problem is that I have a MiniPCI RTL8188CE device in my ThinkPad, and
I want to try writing a driver for it. AFAIK RTL8188CE-VAU (supported in
urtwn) is essencially RTL8188CE with USB bridge, so having access to
documentation urtwn driver was based on would be very helpful.

So, if anyone knows where these docs can be found, I would be very
greatful.

-- 
Dmitrij D. Czarkoff



Re: Documentation for Realtek 8188* devices

2013-11-14 Thread Jean Lucas
 On Nov 14, 2013 7:30 PM, Dmitrij D. Czarkoff czark...@gmail.com wrote:
 
  Hello!
 
  I'm strugling to find any documentation for RTL8188* wireless devices
  (including those already supported in urtwn driver). I wrote to Realtek,
  but no responce followed.
 
  My problem is that I have a MiniPCI RTL8188CE device in my ThinkPad, and
  I want to try writing a driver for it. AFAIK RTL8188CE-VAU (supported in
  urtwn) is essencially RTL8188CE with USB bridge, so having access to
  documentation urtwn driver was based on would be very helpful.
 
  So, if anyone knows where these docs can be found, I would be very
  greatful.
 
  --
  Dmitrij D. Czarkoff
 

 Hi Dmitrij,

 Wishing you the best finding documentation and receiving a response from
Realtek. It is safe to say the latter has become my hobby... Not of
preference but of perseverance.

 Anyway, I've picked up FreeBSD Device Drivers (Kong) which seems like an
okay, albeit rough, place to start understanding drivers for OpenBSD (only
real driver reference out there besides the tree), though adding support
for the PCIe Mini routine of your device shouldn't be the most difficult
feat ever, the cousin chip is already supported. Check out how other cards
(iwn(4)) attach.

 I've an RTL8723AS-VAU which is reportedly a non-mass production analog to
the 8192CU (also urtwn), except with a BT function. There is even a
`urtwn-rtl8723fw' that comes with urtwn but no documentation on those magic
numbers `8723'. We're on similar boats/rafts.

 Please post back your findings. Would be interested in helping you so as
to help myself and others.

 Cheers.

Sorry, swore this was sent to misc for non-tech content. Curses.