!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/arch/mips/ite-boards/generic/   drwxr-xr-x
Free 318.33 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     it8172_cir.c (4.53 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 *
 * BRIEF MODULE DESCRIPTION
 *    IT8172 Consumer IR port generic routines.
 *
 * Copyright 2001 MontaVista Software Inc.
 * Author: MontaVista Software, Inc.
 *             ppopov@mvista.com or source@mvista.com
 *
 *  This program is free software; you can redistribute  it and/or modify it
 *  under  the terms of  the GNU General  Public License as published by the
 *  Free Software Foundation;  either version 2 of the  License, or (at your
 *  option) any later version.
 *
 *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
 *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
 *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
 *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
 *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *  You should have received a copy of the  GNU General Public License along
 *  with this program; if not, write  to the Free Software Foundation, Inc.,
 *  675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <linux/config.h>

#ifdef CONFIG_IT8172_CIR

#include <linux/types.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/init.h>

#include <asm/it8172/it8172.h>
#include <asm/it8172/it8172_cir.h>


volatile struct it8172_cir_regs *cir_regs[NUM_CIR_PORTS] = {
    (volatile struct it8172_cir_regs *)(KSEG1ADDR(IT8172_PCI_IO_BASE + IT_CIR0_BASE)),
    (volatile struct it8172_cir_regs *)(KSEG1ADDR(IT8172_PCI_IO_BASE + IT_CIR1_BASE))};


/*
 * Initialize Consumer IR Port.
 */
int cir_port_init(struct cir_port *cir)
{
    int port = cir->port;
    unsigned char data;

    /* set baud rate */
    cir_regs[port]->bdlr = cir->baud_rate & 0xff;
    cir_regs[port]->bdhr = (cir->baud_rate >> 8) & 0xff;

    /* set receiver control register */
    cir_regs[port]->rcr = (CIR_SET_RDWOS(cir->rdwos) | CIR_SET_RXDCR(cir->rxdcr));

    /* set carrier frequency register */
    cir_regs[port]->cfr = (CIR_SET_CF(cir->cfq) | CIR_SET_HS(cir->hcfs));

    /* set fifo threshold */
    data = cir_regs[port]->mstcr & 0xf3;
    data |= CIR_SET_FIFO_TL(cir->fifo_tl);
    cir_regs[port]->mstcr = data;

    clear_fifo(cir);
    enable_receiver(cir);
    disable_rx_demodulation(cir);

    set_rx_active(cir);
    int_enable(cir);
    rx_int_enable(cir);

    return 0;
}


void clear_fifo(struct cir_port *cir)
{
    cir_regs[cir->port]->mstcr |= CIR_FIFO_CLEAR;
}

void enable_receiver(struct cir_port *cir)
{
    cir_regs[cir->port]->rcr |= CIR_RXEN;
}

void disable_receiver(struct cir_port *cir)
{
    cir_regs[cir->port]->rcr &= ~CIR_RXEN;
}

void enable_rx_demodulation(struct cir_port *cir)
{
    cir_regs[cir->port]->rcr |= CIR_RXEND;
}

void disable_rx_demodulation(struct cir_port *cir)
{
    cir_regs[cir->port]->rcr &= ~CIR_RXEND;
}

void set_rx_active(struct cir_port *cir)
{
    cir_regs[cir->port]->rcr |= CIR_RXACT;
}

void int_enable(struct cir_port *cir)
{
    cir_regs[cir->port]->ier |= CIR_IEC;
}

void rx_int_enable(struct cir_port *cir)
{
    cir_regs[cir->port]->ier |= CIR_RDAIE;
}

void dump_regs(struct cir_port *cir)
{
    printk("mstcr %x ier %x iir %x cfr %x rcr %x tcr %x tfsr %x rfsr %x\n",
    cir_regs[cir->port]->mstcr,
    cir_regs[cir->port]->ier,
    cir_regs[cir->port]->iir,
    cir_regs[cir->port]->cfr,
    cir_regs[cir->port]->rcr,
    cir_regs[cir->port]->tcr,
    cir_regs[cir->port]->tfsr,
    cir_regs[cir->port]->rfsr);

    while (cir_regs[cir->port]->iir & CIR_RDAI) {
        printk("data %x\n", cir_regs[cir->port]->dr);
    }
}

void dump_reg_addr(struct cir_port *cir)
{
    printk("dr %x mstcr %x ier %x iir %x cfr %x rcr %x tcr %x bdlr %x bdhr %x tfsr %x rfsr %x\n",
    (unsigned)&cir_regs[cir->port]->dr,
    (unsigned)&cir_regs[cir->port]->mstcr,
    (unsigned)&cir_regs[cir->port]->ier,
    (unsigned)&cir_regs[cir->port]->iir,
    (unsigned)&cir_regs[cir->port]->cfr,
    (unsigned)&cir_regs[cir->port]->rcr,
    (unsigned)&cir_regs[cir->port]->tcr,
    (unsigned)&cir_regs[cir->port]->bdlr,
    (unsigned)&cir_regs[cir->port]->bdhr,
    (unsigned)&cir_regs[cir->port]->tfsr,
    (unsigned)&cir_regs[cir->port]->rfsr);
}

int cir_get_rx_count(struct cir_port *cir)
{
    return cir_regs[cir->port]->rfsr & CIR_RXFBC_MASK;
}

char cir_read_data(struct cir_port *cir)
{
    return cir_regs[cir->port]->dr;
}

char get_int_status(struct cir_port *cir)
{
    return cir_regs[cir->port]->iir;
}
#endif

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0049 ]--