Subversion Repositories HelenOS

Rev

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

Rev 4743 Rev 4756
Line 42... Line 42...
42
#include "ethernet_lsap.h"
42
#include "ethernet_lsap.h"
43
#include "ethernet_protocols.h"
43
#include "ethernet_protocols.h"
44
#include "hardware.h"
44
#include "hardware.h"
45
 
45
 
46
/** Maps the internetwork layer service to the network interface layer type.
46
/** Maps the internetwork layer service to the network interface layer type.
47
 *  @param nil Network interface layer service. Input parameter.
47
 *  @param[in] nil Network interface layer service.
48
 *  @param il Internetwork layer service. Input parameter.
48
 *  @param[in] il Internetwork layer service.
49
 *  @returns Network interface layer type of the internetworking layer service.
49
 *  @returns Network interface layer type of the internetworking layer service.
50
 *  @returns 0 if mapping is not found.
50
 *  @returns 0 if mapping is not found.
51
 */
51
 */
52
static inline eth_type_t protocol_map( services_t nil, services_t il ){
52
static inline eth_type_t protocol_map( services_t nil, services_t il ){
53
    switch( nil ){
53
    switch( nil ){
Line 65... Line 65...
65
            return 0;
65
            return 0;
66
    }
66
    }
67
}
67
}
68
 
68
 
69
/** Maps the network interface layer type to the internetwork layer service.
69
/** Maps the network interface layer type to the internetwork layer service.
70
 *  @param nil Network interface layer service. Input parameter.
70
 *  @param[in] nil Network interface layer service.
71
 *  @param protocol Network interface layer type. Input parameter.
71
 *  @param[in] protocol Network interface layer type.
72
 *  @returns Internetwork layer service of the network interface layer type.
72
 *  @returns Internetwork layer service of the network interface layer type.
73
 *  @returns 0 if mapping is not found.
73
 *  @returns 0 if mapping is not found.
74
 */
74
 */
75
static inline services_t protocol_unmap( services_t nil, int protocol ){
75
static inline services_t protocol_unmap( services_t nil, int protocol ){
76
    switch( nil ){
76
    switch( nil ){
Line 88... Line 88...
88
            return 0;
88
            return 0;
89
    }
89
    }
90
}
90
}
91
 
91
 
92
/** Maps the link service access point identifier to the Ethernet protocol identifier.
92
/** Maps the link service access point identifier to the Ethernet protocol identifier.
93
 *  @param lsap Link service access point identifier. Input parameter.
93
 *  @param[in] lsap Link service access point identifier.
94
 *  @returns Ethernet protocol identifier of the link service access point identifier.
94
 *  @returns Ethernet protocol identifier of the link service access point identifier.
95
 *  @returns ETH_LSAP_NULL if mapping is not found.
95
 *  @returns ETH_LSAP_NULL if mapping is not found.
96
 */
96
 */
97
static inline eth_type_t lsap_map( eth_lsap_t lsap ){
97
static inline eth_type_t lsap_map( eth_lsap_t lsap ){
98
    switch( lsap ){
98
    switch( lsap ){
Line 104... Line 104...
104
            return ETH_LSAP_NULL;
104
            return ETH_LSAP_NULL;
105
    }
105
    }
106
}
106
}
107
 
107
 
108
/** Maps the Ethernet protocol identifier to the link service access point identifier.
108
/** Maps the Ethernet protocol identifier to the link service access point identifier.
109
 *  @param ethertype Ethernet protocol identifier. Input parameter.
109
 *  @param[in] ethertype Ethernet protocol identifier.
110
 *  @returns Link service access point identifier.
110
 *  @returns Link service access point identifier.
111
 *  @returns 0 if mapping is not found.
111
 *  @returns 0 if mapping is not found.
112
 */
112
 */
113
static inline eth_lsap_t lsap_unmap( eth_type_t ethertype ){
113
static inline eth_lsap_t lsap_unmap( eth_type_t ethertype ){
114
    switch( ethertype ){
114
    switch( ethertype ){
Line 120... Line 120...
120
            return 0;
120
            return 0;
121
    }
121
    }
122
}
122
}
123
 
123
 
124
/** Maps the network interface layer services to the hardware types.
124
/** Maps the network interface layer services to the hardware types.
125
 *  @param nil The network interface service. Input parameter.
125
 *  @param[in] nil The network interface service.
126
 *  @returns The hardware type of the network interface service.
126
 *  @returns The hardware type of the network interface service.
127
 *  @returns 0 if mapping is not found.
127
 *  @returns 0 if mapping is not found.
128
 */
128
 */
129
static inline hw_type_t hardware_map( services_t nil ){
129
static inline hw_type_t hardware_map( services_t nil ){
130
    switch( nil ){
130
    switch( nil ){