Li Yi wrote:
>
> Hi, Roman,
>
> I got two questions regarding your patch on isp1161 driver.
> 1. What will happen if the length is 1 byte in the READ_REGn16 function?
OK, Seems to be a bug ;)
> 2.As not much embedded device will use this kind of ISA card( hcport =
> 0x290), they may directly map those registers into memory and can do 1 step
> reading with FPGA assistant, is that better to define some general macro like
> GET_GRAME_NUMBER(hci) instead of calling READ_REG(hci, **) directly?
>
The READ_REG functions was replacements for the pci read and write
functions of the OHCI root-hub. So they should have been macros
in order to share the code between OHCI root-hub and isp1161 root-hub.
But then it was faster to write the functions and care about
direct code sharing with OHCI later.
Anyway, I am open to change it in any direction.
But I don't think we should use general macros like (GET_RH_STATUS)
because
even if you use memory addressing you have to address the chip-registers
in
a systematic way.
BTW. the GET_FRAME_NUMBER macro is there because hc_simple.c is a
generic
simple frontend for embedded USB host controllers so I have to abstract
that
call there.
regards
Roman
> Thanks and Regards,
>
> Li Yi
>
> static inline void READ_REGn16 (hci_t * hci, int regindex, int length, __u8 *
> buffer)
> {
> hcipriv_t * hp = &hci->hp;
> int i;
> int val = 0;
>
> outw (regindex, hp->hcport + 2);
>
> for (i = 0; i < length; i += 2) {
> val = inw (hp->hcport);
> buffer [i] = val;
> buffer [i+1] = val >> 8;
> }
> if (length & 1) {
> val = inw (hp->hcport);
> buffer [length - 1] = val;
> }
> }
>
> Roman Weissgaerber wrote:
>
> > Hi,
> >
> > enclosed is an experimental version of a host
> > controller driver for a Philips isp1161 HC.
> > The patch is against Linux-2.4.8 but it
> > should also work with other versions.
> > (Just compile hc_isp1161.c; it includes the rest.
> >
> > It consists of a simple HCD frontend for
> > embedded systems (hc_simple.[hc])
> > and a backend for the isp1161
> > (hc_isp1161.[hc] hc_isp1161_rh.c).
> > The root-hub is OHCI compatible but the
> > TD-handling is different (single list).
> > ISO support is not finished yet. I have tested it
> > on a isp1161 ISA card (ES1 chip version) with
> > a HUB, a Keyboard and a pegasus-tongle.
> >
> > Regards
> >
> > Roman
> >
> > ------------------------------------------------------------------------
> > Name: hc_isp1161-0.8.patch.gz
> > hc_isp1161-0.8.patch.gz Type: application/x-gzip
> > Encoding: base64
>
> ------------------------------------------------------------------------
> Name: liyi.vcf
> liyi.vcf Type: VCard (text/x-vcard)
> Encoding: 7bit
> Description: Card for Li Yi
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel