Subversion Repositories Kolibri OS

Rev

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

Rev 1196 Rev 1206
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: 983 $
17
$Revision: 1206 $
18
 
18
 
Line 19... Line 19...
19
MAX_ETH_DEVICES 	equ MAX_NET_DEVICES
19
MAX_ETH_DEVICES 	equ MAX_NET_DEVICES
Line 350... Line 350...
350
;     pointer to destination mac in ebx
350
;     pointer to destination mac in ebx
351
;     packet size in ecx
351
;     packet size in ecx
352
;     device number in edx
352
;     device number in edx
353
;     protocol in di
353
;     protocol in di
354
;
354
;
355
; OUT: edi is -1 on error, pointer to buffer otherwise                    ;; TODO: XCHG EDX AND EBX output parameters
355
; OUT: edi is -1 on error, pointer to buffer otherwise
356
;      eax points to buffer start
356
;      eax points to buffer start
357
;      ebx is size of complete buffer
357
;      ebx is pointer to device structure
358
;      ecx is unchanged (packet size of embedded data)
358
;      ecx is unchanged (packet size of embedded data)
359
;      edx is pointer to device structure
359
;      edx is size of complete buffer
360
;      esi points to procedure wich needs to be called to send packet
360
;      esi points to procedure wich needs to be called to send packet
361
;
361
;
362
;---------------------------------------------------------------------------
362
;---------------------------------------------------------------------------
Line 363... Line 363...
363
 
363
 
364
align 4
364
align 4
Line 365... Line 365...
365
ETH_create_Packet:
365
ETH_create_Packet:
Line 366... Line -...
366
 
-
 
367
	DEBUGF 1,"Creating Ethernet Packet:\n"
-
 
368
 
366
 
369
	cmp	ecx, 60-ETH_FRAME.Data
367
	DEBUGF 1,"Creating Ethernet Packet (size=%u): \n", ecx
Line 370... Line 368...
370
	jl	.exit
368
 
Line 371... Line 369...
371
	cmp	ecx, 1514-ETH_FRAME.Data
369
	cmp	ecx, 1500
Line 392... Line 390...
392
	movsw
390
	movsw
393
	pop	ax
391
	pop	ax
394
	stosw
392
	stosw
Line 395... Line 393...
395
 
393
 
396
	lea	eax, [edi - ETH_FRAME.Data]  ; Set eax to buffer start
394
	lea	eax, [edi - ETH_FRAME.Data]  ; Set eax to buffer start
397
	mov	ebx, ecx		     ; Set ebx to complete buffer size
395
	mov	edx, ecx		     ; Set ebx to complete buffer size
398
	pop	ecx
396
	pop	ecx
Line 399... Line 397...
399
	mov	esi, ETH_Sender
397
	mov	esi, ETH_Sender
400
 
398
 
Line -... Line 399...
-
 
399
	xor	ebx, ebx			;;;; TODO: Fixme
-
 
400
	mov	ebx, [ETH_DRV_LIST + ebx]
-
 
401
 
-
 
402
	cmp	edx, 46 + ETH_FRAME.Data    ; If data size is less then 46, add padding bytes
-
 
403
	jg	.continue
401
	xor	edx, edx			;;;; TODO: Fixme
404
	mov	edx, 46 + ETH_FRAME.Data
402
	mov	edx, [ETH_DRV_LIST + edx]
405
       .continue:
Line 403... Line 406...
403
 
406
 
-
 
407
	DEBUGF 1,"done: %x size:%u device:%x\n", eax, edx, ebx
404
	DEBUGF 1,"done: %x size:%u device:%x\n", eax, ebx, edx
408
	ret
405
	ret
-
 
406
 
409
 
407
  .pop_exit:
410
  .pop_exit:
Line -... Line 411...
-
 
411
	DEBUGF 1,"Out of ram space!!\n"
-
 
412
	add	esp, 18
-
 
413
	or	edi,-1
-
 
414
	ret
Line 408... Line 415...
408
	add	esp, 18
415
 
409
  .exit:
416
  .exit: