Subversion Repositories HelenOS

Rev

Rev 4743 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4743 Rev 4756
Line 29... Line 29...
29
/** @addtogroup dp8390
29
/** @addtogroup dp8390
30
 *  @{
30
 *  @{
31
 */
31
 */
32
 
32
 
33
/** @file
33
/** @file
34
 *  \todo
34
 *  DP8390 network interface implementation.
35
 */
35
 */
36
 
36
 
37
#include <assert.h>
37
#include <assert.h>
38
#include <async.h>
38
#include <async.h>
39
#include <ddi.h>
39
#include <ddi.h>
Line 58... Line 58...
58
 
58
 
59
#include "dp8390.h"
59
#include "dp8390.h"
60
#include "dp8390_drv.h"
60
#include "dp8390_drv.h"
61
#include "dp8390_port.h"
61
#include "dp8390_port.h"
62
 
62
 
-
 
63
/** DP8390 module name.
-
 
64
 */
63
#define NAME    "dp8390 network interface"
65
#define NAME    "dp8390 network interface"
64
 
66
 
-
 
67
/** Returns the device from the interrupt call.
-
 
68
 *  @param[in] call The interrupt call.
-
 
69
 */
65
#define IRQ_GET_DEVICE( call )          ( device_id_t ) IPC_GET_METHOD( * call )
70
#define IRQ_GET_DEVICE( call )          ( device_id_t ) IPC_GET_METHOD( * call )
-
 
71
 
-
 
72
/** Returns the interrupt status register from the interrupt call.
-
 
73
 *  @param[in] call The interrupt call.
-
 
74
 */
66
#define IPC_GET_ISR( call )             ( int ) IPC_GET_ARG2( * call )
75
#define IPC_GET_ISR( call )             ( int ) IPC_GET_ARG2( * call )
67
 
76
 
-
 
77
/** DP8390 kernel interrupt command sequence.
-
 
78
 */
68
static irq_cmd_t    dp8390_cmds[] = {
79
static irq_cmd_t    dp8390_cmds[] = {
69
    {   .cmd = CMD_PIO_READ_8,
80
    {   .cmd = CMD_PIO_READ_8,
70
        .addr = NULL,
81
        .addr = NULL,
71
        .dstarg = 2
82
        .dstarg = 2
72
    },
83
    },
Line 78... Line 89...
78
    {
89
    {
79
        .cmd = CMD_ACCEPT
90
        .cmd = CMD_ACCEPT
80
    }
91
    }
81
};
92
};
82
 
93
 
-
 
94
/** DP8390 kernel interrupt code.
-
 
95
 */
83
static irq_code_t   dp8390_code = {
96
static irq_code_t   dp8390_code = {
84
    sizeof( dp8390_cmds ) / sizeof( irq_cmd_t ),
97
    sizeof( dp8390_cmds ) / sizeof( irq_cmd_t ),
85
    dp8390_cmds
98
    dp8390_cmds
86
};
99
};
87
 
100
 
-
 
101
/** Network interface module global data.
-
 
102
 */
88
netif_globals_t netif_globals;
103
netif_globals_t netif_globals;
89
 
104
 
-
 
105
/** Prints the module name.
-
 
106
 *  @see NAME
-
 
107
 */
90
void    module_print_name( void );
108
void    module_print_name( void );
91
 
109
 
-
 
110
/** Handles the interrupt messages.
-
 
111
 *  This is the interrupt handler callback function.
-
 
112
 *  @param[in] iid The interrupt message identifier.
-
 
113
 *  @param[in] call The interrupt message.
-
 
114
 */
92
void    irq_handler( ipc_callid_t iid, ipc_call_t * call );
115
void    irq_handler( ipc_callid_t iid, ipc_call_t * call );
-
 
116
 
-
 
117
/** Changes the network interface state.
-
 
118
 *  @param[in,out] device The network interface.
-
 
119
 *  @param[in] state The new state.
-
 
120
 *  @returns The new state.
-
 
121
 */
93
int change_state( device_ref device, device_state_t state );
122
int change_state( device_ref device, device_state_t state );
94
 
123
 
95
int netif_specific_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ){
124
int netif_specific_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ){
96
    return ENOTSUP;
125
    return ENOTSUP;
97
}
126
}