Subversion Repositories Kolibri OS

Rev

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

Rev 593 Rev 782
Line 22... Line 22...
22
;;  See file COPYING for details                                   ;;
22
;;  See file COPYING for details                                   ;;
23
;;                                                                 ;;
23
;;                                                                 ;;
24
;;                                                                 ;;
24
;;                                                                 ;;
25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 26... Line 26...
26
 
26
 
Line 27... Line 27...
27
$Revision: 593 $
27
$Revision: 782 $
28
 
28
 
29
 
29
 
Line 305... Line 305...
305
   mov      eax, edi
305
   mov	    eax, edi
Line 306... Line 306...
306
 
306
 
Line 307... Line -...
307
   ret
-
 
308
 
-
 
309
 
-
 
310
 
-
 
311
;***************************************************************************
-
 
312
;   Function
-
 
313
;      I8255x_reset
-
 
314
;   Description
-
 
315
;      Place the chip (ie, the ethernet card) into a virgin state
-
 
316
;      No inputs
-
 
317
;      All registers destroyed
-
 
318
;
-
 
319
;***************************************************************************
-
 
320
I8255x_reset:
-
 
321
   ret
-
 
322
 
307
   ret
323
 
308
 
324
 
309
 
325
;***************************************************************************
310
;***************************************************************************
326
;   Function
311
;   Function
327
;      I8255x_probe
312
;      I8255x_probe
328
;   Description
313
;   Description
329
;      Searches for an ethernet card, enables it and clears the rx buffer
314
;      Searches for an ethernet card, enables it and clears the rx buffer
330
;      If a card was found, it enables the ethernet -> TCPIP link
315
;      If a card was found, it enables the ethernet -> TCPIP link
-
 
316
;
331
;
317
;***************************************************************************
Line 332... Line 318...
332
;***************************************************************************
318
I8255x_probe:
333
I8255x_probe:
319
   DEBUGF 1," K : Probing i8255x device \n"
334
   mov      eax, [io_addr]
320
   mov	    eax, [io_addr]
Line 429... Line 415...
429
   mov      [rxfd_status], ax
415
   mov	    [rxfd_status], ax
430
   mov      ax, 0x0000
416
   mov	    ax, 0x0000
431
   mov      [rxfd_command], ax
417
   mov	    [rxfd_command], ax
Line 432... Line 418...
432
 
418
 
-
 
419
   mov	    eax, rxfd_status
433
   mov      eax, rxfd_status
420
   sub	    eax, OS_BASE
Line 434... Line 421...
434
   mov      [rxfd_link], eax
421
   mov	    [rxfd_link], eax
-
 
422
 
435
 
423
   mov	    eax, Ether_buffer
Line 436... Line 424...
436
   mov      eax, Ether_buffer
424
   sub	    eax, OS_BASE
437
   mov      [rxfd_rx_buf_addr], eax
425
   mov	    [rxfd_rx_buf_addr], eax
Line 444... Line 432...
444
 
432
 
445
   mov      edx, [io_addr]
433
   mov	    edx, [io_addr]
Line 446... Line 434...
446
   add      edx, 4           ; SCBPointer
434
   add	    edx, 4	     ; SCBPointer
-
 
435
 
447
 
436
   mov	    eax, rxfd_status
Line 448... Line 437...
448
   mov      eax, rxfd_status
437
   sub	    eax, OS_BASE
449
   out      dx, eax
438
   out	    dx, eax
Line 466... Line 455...
466
 
455
 
467
   mov      edx, [io_addr]
456
   mov	    edx, [io_addr]
Line 468... Line 457...
468
   add      edx, 4           ; SCBPointer
457
   add	    edx, 4	     ; SCBPointer
-
 
458
 
469
 
459
   mov	    eax, rxfd_status
Line 470... Line 460...
470
   mov      eax, rxfd_status
460
   sub	    eax, OS_BASE
471
   out      dx, eax
461
   out	    dx, eax
Line 497... Line 487...
497
   ; First, set up confcmd values
487
   ; First, set up confcmd values
Line 498... Line 488...
498
 
488
 
499
   mov      ax, 2
489
   mov	    ax, 2
500
   mov      [confcmd_command], ax
490
   mov	    [confcmd_command], ax
-
 
491
   mov	    eax, txfd
501
   mov      eax, txfd
492
   sub	    eax, OS_BASE
Line 502... Line 493...
502
   mov      [confcmd_link], eax
493
   mov	    [confcmd_link], eax
503
 
494
 
Line 504... Line 495...
504
   mov      ax, 1
495
   mov	    ax, 1
505
   mov      [txfd_command], ax         ; CmdIASetup
496
   mov	    [txfd_command], ax	       ; CmdIASetup
Line 506... Line 497...
506
 
497
 
-
 
498
   mov	    ax, 0
507
   mov      ax, 0
499
   mov	    [txfd_status], ax
Line -... Line 500...
-
 
500
 
-
 
501
   mov	    eax, confcmd
508
   mov      [txfd_status], ax
502
   sub	    eax, OS_BASE
Line 509... Line 503...
509
 
503
   mov	    [txfd_link], eax
510
   mov      eax, confcmd
504
 
511
   mov      [txfd_link], eax
505
 
Line 541... Line 535...
541
   mov      [edi], al
535
   mov	    [edi], al
542
   inc      edi
536
   inc	    edi
543
   add      esi, 4
537
   add	    esi, 4
544
   loop     drp001
538
   loop     drp001
Line -... Line 539...
-
 
539
 
545
 
540
 
546
   mov      esi, eeprom_data + (6 * 4)
541
   mov	    esi, eeprom_data + (6 * 4)
547
   mov      eax, [esi]
542
   mov	    eax, [esi]
548
   shr      eax, 8
543
   shr	    eax, 8
549
   and      eax, 0x3f
544
   and	    eax, 0x3f
Line 585... Line 580...
585
   mov      [ebx + 19], al
580
   mov	    [ebx + 19], al
586
   mov      al, 0x05
581
   mov	    al, 0x05
587
   mov      [ebx + 21], al
582
   mov	    [ebx + 21], al
Line 588... Line 583...
588
 
583
 
-
 
584
   mov	    eax, txfd
589
   mov      eax, txfd
585
   sub	    eax, OS_BASE
590
   mov      edx, [io_addr]
586
   mov	    edx, [io_addr]
591
   add      edx, 4            ; SCBPointer
587
   add	    edx, 4	      ; SCBPointer
Line 592... Line 588...
592
   out      dx, eax
588
   out	    dx, eax
Line 615... Line 611...
615
 
611
 
616
 
612
 
-
 
613
 
-
 
614
;***************************************************************************
-
 
615
;   Function
-
 
616
;      I8255x_reset
-
 
617
;   Description
-
 
618
;      Place the chip (ie, the ethernet card) into a virgin state
-
 
619
;      No inputs
-
 
620
;      All registers destroyed
-
 
621
;
-
 
622
;***************************************************************************
-
 
623
I8255x_reset:
-
 
624
   ret
-
 
625
 
-
 
626
 
617
 
627
 
618
;***************************************************************************
628
;***************************************************************************
619
; Function
629
; Function
620
;    I8255x_poll
630
;    I8255x_poll
621
;
631
;
Line 640... Line 650...
640
 
650
 
641
   mov      edx, [io_addr]
651
   mov	    edx, [io_addr]
Line 642... Line 652...
642
   add      edx, 4           ; SCBPointer
652
   add	    edx, 4	     ; SCBPointer
-
 
653
 
643
 
654
   mov	    eax, rxfd_status
Line 644... Line 655...
644
   mov      eax, rxfd_status
655
   sub	    eax, OS_BASE
645
   out      dx, eax
656
   out	    dx, eax
Line 705... Line 716...
705
   mov      eax, txfd
716
   mov	    eax, txfd
706
   mov      [txfd_link], eax
717
   mov	    [txfd_link], eax
707
   mov      eax, 0x02208000
718
   mov	    eax, 0x02208000
708
   mov      [txfd_count], eax
719
   mov	    [txfd_count], eax
709
   mov      eax, txfd_tx_buf_addr0
720
   mov	    eax, txfd_tx_buf_addr0
-
 
721
   sub	    eax, OS_BASE
710
   mov      [txfd_tx_desc_addr], eax
722
   mov	    [txfd_tx_desc_addr], eax
711
   mov      eax, hdr
723
   mov	    eax, hdr
-
 
724
   sub	    eax, OS_BASE
712
   mov      [txfd_tx_buf_addr0], eax
725
   mov	    [txfd_tx_buf_addr0], eax
713
   mov      eax, 14   ; sizeof hdr
726
   mov	    eax, 14   ; sizeof hdr
714
   mov      [txfd_tx_buf_size0], eax
727
   mov	    [txfd_tx_buf_size0], eax
Line 715... Line 728...
715
 
728
 
716
   ; Copy the buffer address and size in
729
   ; Copy the buffer address and size in
-
 
730
   mov	    eax, esi
717
   mov      eax, esi
731
   sub	    eax, OS_BASE
718
   mov      [txfd_tx_buf_addr1], eax
732
   mov	    [txfd_tx_buf_addr1], eax
719
   mov      eax, ecx
733
   mov	    eax, ecx
Line 720... Line 734...
720
   mov      [txfd_tx_buf_size1], eax
734
   mov	    [txfd_tx_buf_size1], eax
-
 
735
 
721
 
736
   mov	    eax, txfd
722
   mov      eax, txfd
737
   sub	    eax, OS_BASE
723
   mov      edx, [io_addr]
738
   mov	    edx, [io_addr]
Line 724... Line 739...
724
   add      edx, 4            ; SCBPointer
739
   add	    edx, 4	      ; SCBPointer