Annotation of qemu/roms/SLOF/slof/fs/usb/usb-kbd-device-support.fs, revision 1.1.1.2

1.1       root        1: \ *****************************************************************************
                      2: \ * Copyright (c) 2004, 2008 IBM Corporation
                      3: \ * All rights reserved.
                      4: \ * This program and the accompanying materials
                      5: \ * are made available under the terms of the BSD License
                      6: \ * which accompanies this distribution, and is available at
                      7: \ * http://www.opensource.org/licenses/bsd-license.php
                      8: \ *
                      9: \ * Contributors:
                     10: \ *     IBM Corporation - initial implementation
                     11: \ ****************************************************************************/
                     12: 
                     13: 
                     14: : rw-endpoint
                     15:   s" rw-endpoint" $call-parent ;
                     16: 
                     17: : controlxfer
                     18:   s" controlxfer" $call-parent ;
                     19: 
                     20: : control-std-get-device-descriptor
                     21:   s" control-std-get-device-descriptor" $call-parent ;
                     22: 
                     23: : control-std-get-configuration-descriptor
                     24:   s" control-std-get-configuration-descriptor" $call-parent ;
                     25: 
                     26: : control-std-set-configuration
                     27:   s" control-std-set-configuration" $call-parent ;
                     28: 
                     29: : control-cls-set-protocol ( reportvalue FuncAddr -- TRUE|FALSE )
                     30:   to temp1
                     31:   to temp2
1.1.1.2 ! root       32:   210b000000000100 kbd-buf kb>setup-packet ! 
        !            33:   temp2 kbd-buf kb>data l!-le
        !            34:   1 kbd-buf kb>data 1 kbd-buf kb>setup-packet
        !            35:   DEFAULT-CONTROL-MPS temp1 controlxfer  
1.1       root       36: ;
                     37: 
                     38: : control-cls-set-idle ( reportvalue FuncAddr -- TRUE|FALSE )
                     39:   to temp1
                     40:   to temp2
1.1.1.2 ! root       41:   210a000000000000 kbd-buf kb>setup-packet ! 
        !            42:   temp2 kbd-buf kb>data l!-le
        !            43:   0 kbd-buf kb>data 0 kbd-buf kb>setup-packet
        !            44:   DEFAULT-CONTROL-MPS temp1 controlxfer  
1.1       root       45: ;
                     46: 
                     47: : control-std-get-report-descriptor ( data-buffer data-len MPS FuncAddr -- TRUE|FALSE )
                     48:   to temp1
                     49:   to temp2
                     50:   to temp3
1.1.1.2 ! root       51:   8106002200000000 kbd-buf kb>setup-packet ! 
        !            52:   temp3 kbd-buf kb>setup-packet 6 + w!-le
        !            53:   0 swap temp3 kbd-buf kb>setup-packet
        !            54:   temp2 temp1 controlxfer  
1.1       root       55: ;
                     56: 
                     57: : kbd-init
                     58:     s" Starting to initialize keyboard" usb-debug-print
                     59:     s" MPS-INTIN" get-my-property
                     60:     if
                     61:        s" not possible" usb-debug-print
                     62:     else
                     63:        decode-int nip nip to mps-int-in
                     64:     then
                     65:     s" INT-IN-EP-ADDR" get-my-property
                     66:     if
                     67:        s" not possible" usb-debug-print
                     68:     else
                     69:        decode-int nip nip to int-in-ep
                     70:     then
                     71: 
1.1.1.2 ! root       72:    kbd-buf kb>cfg 12 8 kbd-addr           \ get device descriptor
        !            73:    control-std-get-device-descriptor
        !            74:    drop
        !            75:    \ s" dev_desc=" type cfg-buffer 12 dump cr
        !            76: 
        !            77:    kbd-buf kb>cfg 9 8 kbd-addr            \ get config descriptor  
        !            78:    control-std-get-configuration-descriptor
        !            79:    drop
        !            80:    \ s" cfg_desc=" type cfg-buffer 9 dump cr
        !            81: 
        !            82:    kbd-buf kb>cfg 5 + c@ kbd-addr         \ set configuration  
        !            83:    control-std-set-configuration
        !            84:    drop
        !            85:    s" KBDS: Set config returned" usb-debug-print 
        !            86: 
        !            87:    0 kbd-addr control-cls-set-idle drop       \ set idle  
        !            88:    s" KBDS: Set idle returned" usb-debug-print
        !            89: 
        !            90:    kbd-buf kb>cfg 3f 8 kbd-addr           \ get report descriptor
        !            91:    control-std-get-report-descriptor
        !            92:    drop
        !            93:    \ s" report_desc=" type cfg-buffer 3f dump cr
1.1       root       94: 
1.1.1.2 ! root       95:    s" Finished initializing keyboard" usb-debug-print 
1.1       root       96: ;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.