Subversion Repositories Kolibri OS

Rev

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

Rev 1237 Rev 1254
Line 21... Line 21...
21
;;  Updates:                                                          ;;
21
;;  Updates:                                                          ;;
22
;;    Revision Look up table and SIS635 Mac Address by Jarek Pelczar  ;;
22
;;    Revision Look up table and SIS635 Mac Address by Jarek Pelczar  ;;
23
;;                                                                    ;;
23
;;                                                                    ;;
24
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 25... Line 25...
25
 
25
 
Line 26... Line 26...
26
; $Revision: 1237 $
26
; $Revision: 1254 $
Line 27... Line 27...
27
 
27
 
Line 1247... Line 1247...
1247
;***************************************************************************
1247
;***************************************************************************
1248
;   Function
1248
;   Function
1249
;      transmit
1249
;      transmit
1250
;   Description
1250
;   Description
1251
;      Transmits a packet of data via the ethernet card
1251
;      Transmits a packet of data via the ethernet card
1252
;         buffer pointer in [esp]
1252
;         buffer pointer in [esp+4]
1253
;         size of buffer in [esp+4]
1253
;         size of buffer in [esp+8]
1254
;         pointer to device structure in ebx
1254
;         pointer to device structure in ebx
1255
;
1255
;
1256
;      only one transmit descriptor is used
1256
;      only one transmit descriptor is used
1257
;
1257
;
1258
;***************************************************************************
1258
;***************************************************************************
Line 1261... Line 1261...
1261
SIS900_Debug_Transmit_Packet_Err db 'Transmitting Packet Error: ',13,10,0
1261
SIS900_Debug_Transmit_Packet_Err db 'Transmitting Packet Error: ',13,10,0
1262
end if
1262
end if
1263
str1 db 'Transmitting packet:',13,10,0
1263
str1 db 'Transmitting packet:',13,10,0
1264
str2 db ' ',0
1264
str2 db ' ',0
1265
transmit:
1265
transmit:
1266
   cmp      dword [esp+4], MAX_ETH_FRAME_SIZE
1266
   cmp	    dword [esp+8], MAX_ETH_FRAME_SIZE
1267
   jg       transmit_finish
1267
   jg	    transmit_finish
1268
   cmp      dword [esp+4], 60
1268
   cmp	    dword [esp+8], 60
1269
   jl       transmit_finish
1269
   jl	    transmit_finish
1270
   push     ebp
1270
   push     ebp
1271
   mov      ebp, [ebx+device.io_addr] ; Base Address
1271
   mov	    ebp, [ebx+device.io_addr] ; Base Address
1272
   ;******** Stop the transmitter ********
1272
   ;******** Stop the transmitter ********
1273
   lea      edx,[ebp+SIS900_cr] ; Command Register offset
1273
   lea	    edx,[ebp+SIS900_cr] ; Command Register offset
Line 1279... Line 1279...
1279
   mov      eax, ebx
1279
   mov	    eax, ebx
1280
   call     GetPgAddr
1280
   call     GetPgAddr
1281
   add      eax, device.txd
1281
   add	    eax, device.txd
1282
   out      dx, eax
1282
   out	    dx, eax
1283
   ;******* copy packet to descriptor*******
1283
   ;******* copy packet to descriptor*******
1284
   mov     esi, [esp+4]
1284
   mov	   esi, [esp+8]
1285
   lea     edi, [ebx+0x1000]
1285
   lea	   edi, [ebx+0x1000]
1286
   mov     ecx, [esp+8]
1286
   mov	   ecx, [esp+12]
1287
   mov     edx, ecx
1287
   mov	   edx, ecx
1288
   shr     ecx, 2
1288
   shr	   ecx, 2
1289
   and     edx, 3
1289
   and	   edx, 3
1290
   rep     movsd
1290
   rep	   movsd
1291
   mov     ecx, edx
1291
   mov	   ecx, edx
1292
   rep     movsb
1292
   rep	   movsb
1293
   ;**************set length tag**************
1293
   ;**************set length tag**************
1294
   mov     ecx, [esp+8]                  ;restore packet size
1294
   mov	   ecx, [esp+12]		  ;restore packet size
1295
   and     ecx, SIS900_DSIZE     ;
1295
   and	   ecx, SIS900_DSIZE	 ;
1296
   inc      [ebx+device.packets_tx]
1296
   inc	    [ebx+device.packets_tx]
1297
   add      dword [ebx+device.bytes_tx], ecx
1297
   add	    dword [ebx+device.bytes_tx], ecx
1298
   adc      dword [ebx+device.bytes_tx+4], 0
1298
   adc	    dword [ebx+device.bytes_tx+4], 0
1299
   ;**************pad to minimum packet size **************not needed
1299
   ;**************pad to minimum packet size **************not needed
Line 1329... Line 1329...
1329
   call     sys_msg_board_str
1329
   call     sys_msg_board_str
1330
end if
1330
end if
1331
SIS900_transmit_OK:
1331
SIS900_transmit_OK:
1332
   pop      ebp
1332
   pop	    ebp
1333
transmit_finish:
1333
transmit_finish:
1334
   call     KernelFree
-
 
1335
   add      esp, 4
-
 
1336
   ret
1334
   ret
Line 1337... Line 1335...
1337
 
1335
 
1338
;***************************************************************************
1336
;***************************************************************************
1339
;* Function: Create_Mac_String
1337
;* Function: Create_Mac_String