Subversion Repositories Kolibri OS

Rev

Rev 2305 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2305 Rev 2311
Line 12... Line 12...
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
13
;;             Version 2, June 1991                                ;;
13
;;             Version 2, June 1991                                ;;
14
;;                                                                 ;;
14
;;                                                                 ;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
$Revision: 2305 $
17
$Revision: 2311 $
Line 18... Line 18...
18
 
18
 
19
struct	ETH_header
19
struct  ETH_header
Line 111... Line 111...
111
	DEBUGF	1,"ETH_output: size=%u device:%x\n", ecx, ebx
111
        DEBUGF  1,"ETH_output: size=%u device:%x\n", ecx, ebx
Line 112... Line 112...
112
 
112
 
113
	cmp	ecx, [ebx + NET_DEVICE.mtu]
113
        cmp     ecx, [ebx + NET_DEVICE.mtu]
Line 114... Line 114...
114
	ja	.exit
114
        ja      .exit
115
 
115
 
116
	push	ecx			; << 1
-
 
117
	push	di eax edx		; << 2
-
 
118
	add	ecx, sizeof.ETH_header
-
 
Line 119... Line 116...
119
 
116
        push    ecx
120
	push	ecx			; << 3
117
        push    di eax edx
121
 
118
 
122
	push	ecx			; << 4
119
        add     ecx, sizeof.ETH_header
123
	call	kernel_alloc		; >> 4
120
        stdcall kernel_alloc, ecx
Line 124... Line -...
124
	test	eax, eax
-
 
125
	jz	.out_of_ram
-
 
126
	mov	edi, eax
121
        test    eax, eax
127
 
122
        jz      .out_of_ram
128
	pop	ecx			; >> 3
123
        mov     edi, eax
129
 
124
 
130
	pop	esi			; >> 2
125
        pop     esi
131
	movsd
126
        movsd
132
	movsw
127
        movsw
133
	pop	esi			; >> 2
128
        pop     esi
Line 134... Line 129...
134
	movsd
129
        movsd
-
 
130
        movsw
135
	movsw
131
        pop     ax
136
	pop	ax			; >> 2
-
 
137
	stosw
-
 
Line 138... Line 132...
138
 
132
        stosw
139
	lea	eax, [edi - sizeof.ETH_header]	; Set eax to buffer start
133
 
140
	mov	edx, ecx			; Set edx to complete buffer size
134
        lea     eax, [edi - sizeof.ETH_header]  ; Set eax to buffer start
141
 
135
        pop     ecx
Line 151... Line 145...
151
	test	edx, edx	; clear zero flag
145
        test    edx, edx        ; clear zero flag
152
	ret
146
        ret
Line 153... Line 147...
153
 
147
 
154
  .out_of_ram:
148
  .out_of_ram:
155
	DEBUGF	2,"ETH_output: Out of ram space!!\n"
149
        DEBUGF  2,"ETH_output: Out of ram space!!\n"
156
	add	esp, 3*4+2+4
150
        add     esp, 4+4+2+4
157
	sub	edi, edi
151
        sub     edi, edi
Line 158... Line 152...
158
	ret
152
        ret
159
 
153
 
160
  .exit:
154
  .exit:
161
	DEBUGF	2,"ETH_output: Packet too large!\n"
-
 
162
	sub	edi, edi
155
        DEBUGF  2,"ETH_output: Packet too large!\n"
Line 163... Line 156...
163
;;;        dec     edi
156
        sub     edi, edi