-static int
-a3c90x_poll(struct nic *nic, int retrieve)
- {
- int i, errcode;
-
- if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0010))
- {
- return 0;
- }
-
- if ( ! retrieve ) return 1;
-
- /** we don't need to acknowledge rxComplete -- the upload engine
- ** does it for us.
- **/
-
- /** Build the up-load descriptor **/
- INF_3C90X.ReceiveUPD.UpNextPtr = 0;
- INF_3C90X.ReceiveUPD.UpPktStatus = 0;
- INF_3C90X.ReceiveUPD.DataAddr = v2p(nic->packet);
- INF_3C90X.ReceiveUPD.DataLength = 1536 + (1<<31);
-
- /** Submit the upload descriptor to the NIC **/
- _outl(v2p(&(INF_3C90X.ReceiveUPD)),
- INF_3C90X.IOAddr + regUpListPtr_l);
-
- /** Wait for upload completion (upComplete(15) or upError (14)) **/
- for(i=0;i<40000;i++);
- while((INF_3C90X.ReceiveUPD.UpPktStatus & ((1<<14) | (1<<15))) == 0)
- for(i=0;i<40000;i++);
-
- /** Check for Error (else we have good packet) **/
- if (INF_3C90X.ReceiveUPD.UpPktStatus & (1<<14))
+static struct pbuf * a3c90x_poll(struct nic *nic)
+{
+ int errcode;
+ struct pbuf *p;
+
+ if (!currecv)
+ _setup_recv(nic);
+
+ /* Nothing to do? */
+ if ((rxdesc.status & ((1<<14) | (1<<15))) == 0)
+ return NULL;
+
+ p = currecv;
+
+ /** Check for Error (else we have good packet) **/
+ if (rxdesc.status & (1<<14))