Re: Writing driver for a net device which does not support interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 23 Mar 2015 18:51:51 +0800, Freeman Zhang said:
> I'm writing a net device driver for my final project in college. But the
> half-finished device doesn't support interrupt yet(those hardware guys...)
>
> So I'm wondering if there is some way to poll the device for its status
> and events.

As a realistic datapoint - if it still doesn't support interrupts, the *rest*
of it is probably still so buggy that trying to write a driver isn't worth
the effort.

It's doable if you are working with a group of talented and experienced
engineers - but if the hardware is also being done as a final project,
you're in for naught but misery.

You *could* do something like this:

      while (waiting) {
          status = read_status_bits(your_device);
          if (status & DATA_AVAIL_MASK) break;
          msleep(100);
      }

But having seen enough student hardware design projects in my life, I estimate
that if it still can't signal interrupts, the status bits probably aren't valid
either. (Think about it - a bog-simple implementation of interrupts would be
to just feed a transition-high on the appropriate status bit to the interrupt
pin, and use a read from the chip to clear the pin).

Good luck - I suspect you're going to need it....

Attachment: pgpOiQMQ1DNQR.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux