Building driver for Silicon Labs CP2200 Ethernet chip
Arnout Vandecappelle
arnout at mind.be
Wed Apr 30 07:55:46 UTC 2008
Chris Johns wrote:
> Many thanks for this driver. I have a couple of questions, one of
> which is more generic than specific to this driver.
>
> When does a user need to use CP220X_DO_SHUTDOWN ? I cannot see any
> documentation about this define.
Oops, indeed I forgot to document that.
The board I was using had a hardware bug, due to which it was unable to
issue a reset of the CP2200 chip. Therefore, once the chip was shut
down it was impossible to start it again. I therefore had to remove the
shutdown from the driver.
Probably a better option would be to record this in the driver
configuration, so it can be set from the BSP or from the application...
However, I discovered this problem only at the last minute, so I didn't
implement it that way.
Actually, perhaps it's best to simply remove the #ifdefs: on any
working board, they shouldn't be needed and shutdown should always be
used. Of course, I never tested that code...
> I see the driver has printf and being based on the cs8900 I am the
> source of this. Should we have these driver use printf or should they
> use printk now it exists ?
I'm not sure what exactly the difference is between printf and printk,
except that printk can be called from interrupt context. Since none of
the prints are from interrupt context, and since with printk my terminal
tended to drop newlines, I went for printf... I'm sure these are not
good reasons :-)
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Mind Embedded Development (an Essensium division)
More information about the users
mailing list