Changeset 1740 for Whitix/branches

Show
Ignore:
Timestamp:
01/03/09 16:25:53 (3 years ago)
Author:
mwhitworth
Message:

Add start of ring allocation to PCNet driver.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/netchannel/devices/net/pcnet.c

    r1683 r1740  
    2727#include <print.h> 
    2828 
     29/* Defines */ 
     30 
     31/* Resonable default values are 4 send buffers, and 16 receive uffers. */ 
     32#define PCNET32_LOG_SEND_BUFFERS                4 
     33#define PCNET32_LOG_RECV_BUFFERS                5 
     34 
     35#define PCNET32_SEND_RING_SIZE                  (1 << (PCNET32_LOG_SEND_BUFFERS)) 
     36#define PCNET32_RECV_RING_SIZE                  (1 << (PCNET32_LOG_RECV_BUFFERS)) 
     37 
    2938/* Structures */ 
    3039struct PcNetInitBlock 
     
    3948}; 
    4049 
     50/* Ring descriptors. Used by the card. */ 
     51struct PcNetRecvHead 
     52{ 
     53        DWORD base; 
     54        WORD bufLen; 
     55        WORD status; 
     56        DWORD msgLen; 
     57        DWORD reserved; 
     58}; 
     59 
     60struct PcNetSendHead 
     61{ 
     62        DWORD base; 
     63        WORD length; /* Two's complement of length. */ 
     64        WORD status; 
     65        DWORD misc; 
     66        DWORD reserved; 
     67}; 
     68 
    4169struct PcNetIoOps 
    4270{ 
     
    136164                memcpy(macAddr, promAddr, 6); 
    137165        } 
     166} 
     167 
     168static int PcNetAllocRings(struct PcNetDevice* device) 
     169{ 
     170        /* Allocate the send and recv rings. */ 
     171        return 0; 
    138172} 
    139173 
     
    199233         
    200234        ret->initBlock->mode = 0x0003; 
    201         /* lens */ 
     235        ret->initBlock->lens = (4 << 12) | (5 << 4); 
    202236         
    203237        for (i = 0; i < 6; i++)