linux/drivers/firmware/dcdbas.c
<<
>>
Prefs
   1/*
   2 *  dcdbas.c: Dell Systems Management Base Driver
   3 *
   4 *  The Dell Systems Management Base Driver provides a sysfs interface for
   5 *  systems management software to perform System Management Interrupts (SMIs)
   6 *  and Host Control Actions (power cycle or power off after OS shutdown) on
   7 *  Dell systems.
   8 *
   9 *  See Documentation/dcdbas.txt for more information.
  10 *
  11 *  Copyright (C) 1995-2006 Dell Inc.
  12 *
  13 *  This program is free software; you can redistribute it and/or modify
  14 *  it under the terms of the GNU General Public License v2.0 as published by
  15 *  the Free Software Foundation.
  16 *
  17 *  This program is distributed in the hope that it will be useful,
  18 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  19 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20 *  GNU General Public License for more details.
  21 */
  22
  23#include <linux/platform_device.h>
  24#include <linux/dma-mapping.h>
  25#include <linux/errno.h>
  26#include <linux/gfp.h>
  27#include <linux/init.h>
  28#include <linux/kernel.h>
  29#include <linux/mc146818rtc.h>
  30#include <linux/module.h>
  31#include <linux/reboot.h>
  32#include <linux/sched.h>
  33#include <linux/smp.h>
  34#include <linux/spinlock.h>
  35#include <linux/string.h>
  36#include <linux/types.h>
  37#include <linux/mutex.h>
  38#include <asm/io.h>
  39
  40#include "dcdbas.h"
  41
  42#define DRIVER_NAME             "dcdbas"
  43#define DRIVER_VERSION          "5.6.0-3.2"
  44#define DRIVER_DESCRIPTION      "Dell Systems Management Base Driver"
  45
  46static struct platform_device *dcdbas_pdev;
  47
  48static u8 *smi_data_buf;
  49static dma_addr_t smi_data_buf_handle;
  50static unsigned long smi_data_buf_size;
  51static u32 smi_data_buf_phys_addr;
  52static DEFINE_MUTEX(smi_data_lock);
  53
  54static unsigned int host_control_action;
  55static unsigned int host_control_smi_type;
  56static unsigned int host_control_on_shutdown;
  57
  58/**
  59 * smi_data_buf_free: free SMI data buffer
  60 */
  61static void smi_data_buf_free(void)
  62{
  63        if (!smi_data_buf)
  64                return;
  65
  66        dev_dbg(&dcdbas_pdev->dev, "%s: phys: %x size: %lu\n",
  67                __func__, smi_data_buf_phys_addr, smi_data_buf_size);
  68
  69        dma_free_coherent(&dcdbas_pdev->dev, smi_data_buf_size, smi_data_buf,
  70                          smi_data_buf_handle);
  71        smi_data_buf = NULL;
  72        smi_data_buf_handle = 0;
  73        smi_data_buf_phys_addr = 0;
  74        smi_data_buf_size = 0;
  75}
  76
  77/**
  78 * smi_data_buf_realloc: grow SMI data buffer if needed
  79 */
  80static int smi_data_buf_realloc(unsigned long size)
  81{
  82        void *buf;
  83        dma_addr_t handle;
  84
  85        if (smi_data_buf_size >= size)
  86                return 0;
  87
  88        if (size > MAX_SMI_DATA_BUF_SIZE)
  89                return -EINVAL;
  90
  91        /* new buffer is needed */
  92        buf = dma_alloc_coherent(&dcdbas_pdev->dev, size, &handle, GFP_KERNEL);
  93        if (!buf) {
  94                dev_dbg(&dcdbas_pdev->dev,
  95                        "%s: failed to allocate memory size %lu\n",
  96                        __func__, size);
  97                return -ENOMEM;
  98        }
  99        /* memory zeroed by dma_alloc_coherent */
 100
 101        if (smi_data_buf)
 102                memcpy(buf, smi_data_buf, smi_data_buf_size);
 103
 104        /* free any existing buffer */
 105        smi_data_buf_free();
 106
 107        /* set up new buffer for use */
 108        smi_data_buf = buf;
 109        smi_data_buf_handle = handle;
 110        smi_data_buf_phys_addr = (u32) virt_to_phys(buf);
 111        smi_data_buf_size = size;
 112
 113        dev_dbg(&dcdbas_pdev->dev, "%s: phys: %x size: %lu\n",
 114                __func__, smi_data_buf_phys_addr, smi_data_buf_size);
 115
 116        return 0;
 117}
 118
 119static ssize_t smi_data_buf_phys_addr_show(struct device *dev,
 120                                           struct device_attribute *attr,
 121                                           char *buf)
 122{
 123        return sprintf(buf, "%x\n", smi_data_buf_phys_addr);
 124}
 125
 126static ssize_t smi_data_buf_size_show(struct device *dev,
 127                                      struct device_attribute *attr,
 128                                      char *buf)
 129{
 130        return sprintf(buf, "%lu\n", smi_data_buf_size);
 131}
 132
 133static ssize_t smi_data_buf_size_store(struct device *dev,
 134                                       struct device_attribute *attr,
 135                                       const char *buf, size_t count)
 136{
 137        unsigned long buf_size;
 138        ssize_t ret;
 139
 140        buf_size = simple_strtoul(buf, NULL, 10);
 141
 142        /* make sure SMI data buffer is at least buf_size */
 143        mutex_lock(&smi_data_lock);
 144        ret = smi_data_buf_realloc(buf_size);
 145        mutex_unlock(&smi_data_lock);
 146        if (ret)
 147                return ret;
 148
 149        return count;
 150}
 151
 152static mutex_unlock(&aEikdta_buf_size_store" class="sesulref">mutex_unloesul="+code=device_attribesupref">mutex_unloesup="sreff_size_store" class="skobjec );
 *  53
 135                                       const char *buf, size_t ;
;
 138        ssize_t ;
  57
 143        mutex_lock(&smomment">/1**
 144           " name="L143"> 1" namaEikd_from_/a>   href="+code=simple_strtoul" class="sref">simple_strtoul(ef">dev, smi_data_buf_size, 
, "%lu\n", smi_daomment"> 1*/
 145        mutex_unlock(&smbuf_free<1/a>(void)
 147                return 1  62{
smi_data1_buf)
 152static mutex_unloesul="+code=device_attribesupref">mutex_unloesup="sreff_size_store" class="skobjec   65
 *,
 135                                       const char *buf, size_t );
  68
 138        ssize_t smi_data1_buf,
);
s>        if (size > MAX_SMI_1s="sref">1NULL;
  89                return - = 0;
 = 0;
 143        mutex_lock(&sm_buf_size1 = 0;
1  75}
 144        ret = sf="+code=smi_data_lock" class="sref">sm_omment"> **
 146        if (/1**

 1*/
 102                 108        , simple_strtoul(sf="+code=smi_data_lock" class="sref">sms="sref">1size)
 144         149        return 1  81{
buf;
 145        mutex_unlock(&sm"sref">ha1ndle;
 147                return   84
1size)
 152static ssize_tsmi_data_buf_size_store(struct device *  87
 134                                       struct device_attribute *)
 128                                      char *EI1NVAL;
  90
 130        return sprintf(buf,   54static unsigned int sms needed 1*/
GFP_KER1NEL);
b1uf) {
 152static ssize_tsmi_data_buf_size_store(struct device *dev,
 134                                       struct device_attribute *,
 135                                       const char *buf, size_t s1ize);
;
 138        ssize_t   981        }

/* new buffer i2e="L100">2100
 143        mutex_lock(&s2smi_data_2uf)
 144        ret = mutex_unloapm_cmda hreef="+code=smi_data_lock" class="sref">s2sme="L22">e);
 145        mutex_unlock(&s2e="L103">2103
 146        if (
 147                return ();
2106
  54static unsigned int buf_size = simple_strtoul(buf,  149        return 2uf;
han2le;
b2f);
 152static ssize_tsmi_data_buf_size_store(struct device *s2ze;
 134                                       struct device_attribute *2112
 128                                      char *,
);
 130        return sprintf(buf,   55static unsigned int 2115
2turn 0;
 217}
 152static ssize_tsmi_data_buf_size_store(struct device *2118
 134                                       struct device_attribute *2ev,
 135                                       const char *buf, size_t a2tr,
2uf)
  55static unsigned int buf_size = simple_strtoul(buf,  222{
 149        return );
 224}
2125
 126static ssize_tsmi_data_buf_size_store(struct device *2ev,
 134                                       struct device_attribute * 2tr,
 128                                      char *2uf)
 229{
 130        return sprintf(buf,   56static unsigned int  231}
2132
 133static ssize_tsmi_data_buf_size_store(struct device *2ev,
 134                                       struct device_attribute *a2tr,
 135                                       const char *buf, size_t co2nt)
 236{
  56static unsigned int buf_size = simple_strtoul(buf, buf_s2ze;
 149        return 2et;
2139
NULL, 10);
  772141
requestass="line" name="L77">  772
  772k);
(&<.ass="line" name="L77">  77a2e);
  79mutex_unlo+codcmd="+code=device_attrib+codcmdref">mutex_unlo+codcmd="+csize_t 2et)
2et;
 cpumask_valinef">buf,  old_mask        return 2148
 144"L116" class="line" name="L116"> 116co2nt;
 250}
mutex_unlo+codcmd="+ca href="+code=dcdbasmagiass="sref">retret        if (!2151
 1info                 s1info dev_dbg(&dcdbas_pdev->"%s: phys: %x size: %2mi_data_l2ock);
 114           buf,  114;
;
;
requires CPU 0 class="line" name="L79">  79  57
      pumask_val class="sref">de      pumask_val  old_mask    a>, &handle, size_t /2**
  97                return -
 2*/
 102< pumask_conahref="+code=simple_sold_maske" name="L83"> old_mask    a>ref="+code=mutex_unlcurf" class="sref">bufcurf" cmp;mutex_unlo pusa>   wed    buf,    wed_pe" class="sref">dset_ pusa>   wed_pe"href="+code=simple_scurf" class="sref">bufcurf" cmp;(s2me="L62">2  62{
mutex_unlo+cp_processor_idhref=)b!  0s>        if (!smi_data2_buf)
  94                dev_dbg(&dcdbasclass="line" name="L95">  95              get CPU 0class="string">"%s: phys: %x size: %2         2  return;
 114           buf,   65
 144class="line" nameBUSY="L114"> 114,
, );
  68
smi_data2_buf,
class="line" name="L79">  79happen now>class="line" name="L79">  79  792 = 0;
  95oulb, ne" name="L79">  79  95inb  ne" name="L79">  79  79}
  95aass="string">" id="L101" class="licmdref">mutex_unlo+codcmd="+ca href="+code=dcdbas claan/_cdbaname="L149"> 1492**
  95dass="string">" id="L101" class="licmdref">mutex_unlo+codcmd="+ca href="+code=dcdbas claan/_smi_essname="L149"> 149
  95bass="string">" id="L101" class="licmdref">mutex_unlo+codcmd="+ca href="+code=dcdbasebxref">mutex_unloebx    b"%s: phys: %x size: %2_me="L68"2ed
  95cass="string">" id="L101" class="licmdref">mutex_unlo+codcmd="+ca href="+code=dcdbasecxref">mutex_unloecx="+csize_t  2*/
  951" namass="string">ne" name="L79">  792size)
2  81{
buf;
ha2ndle;
   wed_pe" class="sref">dset_ pusa>   wed_pe"href="+code=simple_scurf" class="sref">bufcurf" cmp;( old_mask    buf, dfree  pumask_valhref="+code=simple_sold_maske" name="L83"> old_mask    buf, )
 uf, 2return 0;
  87
)
  77EI2NVAL;
  772>  90
  77  77);
 142   ass="line" name="L77">  77ha2uf) {
  ="L1c#Lerfacam42"ass="line" name="L77">  77dev,
  77,
  772ize);
(& befor  te  ="L1L77"> ass="line" name="L77">  77;
  77class="line" name="L79">  79 152static mutex_unlo+codrequestass="sta_buf_size_store" class="sref">smi_data_buf_size_store(struct device *3100
 134                                       struct device_attribute *)
 135                                       const char *buf, size_t );
3103
mutex_unlo+codcmd="+code=device_attrib+codcmdref">mutex_unlo+codcmd="+cuf, mutex_unloval4"> 144 const char *buf_size = simple_strtoul(buf,  138        ssize_t 3106

 143        mutex_lock(&s3s="sref">3uf;
han3le;
"%lu\n", mutex_unlo+codcmd="+css>        if (!b3f);
 144class="line" nameNODEV">  97        DEV"sref">ssize_t s3ze;
3112
,
mutex_unlo+codcmd="+co= uf_size_store" class="s+codcmdref">mutex_unlo+codcmd="+cod)id="L101" class="liring">&q#37;lu\n", );
3115
mutex_unloval4"> s>        if (!3turn 0;
}
class="line" name="L79">  793118
 144 mutex_unlo+codcmd="+cs return -3ev,
 146        if (a3tr,
 144  149        return 3uf)
322{
);
class="line" name="L79">  79 324}
mutex_unlo+codcmd="+ca href="+code=dcdbasebxref">mutex_unloebx    o= uf="+code=dcdbasu31}
 14virt_to_physta_bustore" class="s+codcmdref">mutex_unlo+codcmd="+ca href="+code=dcdbas claan/_/a>   " name="L143">  claan/_/a>   ="+cs return -3125
 144 mutex_unlo+codcmd="+cs return -3ev,
 146        if (,
 144  149        return 3uf)
 329{
);
smi_data_buf_size, smi_d3="L131"> 331}
 144  149        return 3132
,
 3tr,
 144class="line" name="L89">  89                return -co3nt)
336{
buf_s3ze;
3et;
3139
 145        mutex_unlock(&s3f">NULL, 10);
ssize_t 3141
3
  89      XPORT_SYMBO9ta_bustore" class="s=dev_db+codrequest                 clas"+codrequestta_bef="+code=smi_data_lock" class="sref">s3f_phys_ad3k);
a3e);
  77  773et)
  77buf_s3et;
,   773148
class="line" name="L79">  79co3nt;
        if ( 350}
3151
mutex_unloapm_cmda hrode=device_attribupm_cmdref">mutex_unloapm_cmda hrf="+code=smi_data_lock" class="sref">s3mi_data_l3ock);
mutex_unlou8e(struct s3m_phys_ad3>  53
 14flagsa hrf="+code=smi_data_lock" class="sref">s3m"sref">a3tion;
}
 14num_basksa hrf="+code=smi_data_lock" class="sref">s3m_data_lo3type;
mutex_unlos8ef">buf,  149md_dcdbusa hrf="+code=smi_data_lock" class="sref">s3m="sref">3down;
mutex_unlou8e0>, mutex_unloindexa hrf="+code=smi_data_lock" class="sref">s3mf">buf_s3>  57
/3**
mutex_unloapm_cmda hro= uf_size_store" class="sapm_cmdref">mutex_unloapm_cmda hrod)id="L101" class="liring">&q#37;lu\n", 
mutex_unloapm_cmda hra href="+code=dcdbasdcdbusname="L149"> 14dcdbusa hr144   89      SM_STATUShCMD_UNSUCCESSFU9     return - 3*/
3/a>(void)
  55static unsigned int 3  62{
smi_data3_buf)
mutex_unlortcss="ssimple_strtoul( 14flagsa href="+code=smi_data_lock" class="sref">s3         3  return;
 142    physical smi_ess>class="line" name="L79">  79  65
,                 >, a hro= uf="+code=dcdbasu8ref">mutex_unlou8e()ref="+code=mutex_unlock" clasa hrphys_smi_#37;lu\n", 3;,
mutex_unloindexa hr144  114buf_s3ize);
mutex_unloindexa hr1< uf="+code=dcdbasPE1300hCMOShCMD_STRUCT_PTR="L114"> 114s3 mment">/3>  68
mutex_unloindexa hr++le_strtoul(,                 >, a hr++b>        if (!smi_data3_buf,
, mutex_unloindexa hrtribute *);
mutex_unloCMOShBASE_PORT     + store" class="sCMOShPAGE2_INDEX_PORT_PIIX4ref">mutex_unloCMOShPAGE2_INDEX_PORT_PIIX4a hreef="+code=smi_data_lock" class="sref">s3auf_free<3NULL;
, ,                 >, a hrtribute *3 = 0;
mutex_unloCMOShBASE_PORT     + store" class="sCMOShPAGE2_DATA_PORT_PIIX4ref">mutex_unloCMOShPAGE2_DATA_PORT_PIIX4a hreef="+code=smi_data_lock" class="sref">s3asmi_data3 = 0;
 = 0;
}
  ed by spec>class="line" name="L79">  793**
 149md_dcdbusa hr144   89      SM_STATUShCMD_UNSUCCESSFU9     return -
mutex_unlou8e 149md_dcdbusa hrle_strtoul(mutex_unloPCAT_APM_STATUShPORTa href="+code=smi_data_lock" class="sref">s3_me="L68"3ed
 3*/
  793size)
  89      SM_APM_CMDa hrle_strtoul(mutex_unloPCAT_APM_CONTROLhPORTa href="+code=smi_data_lock" class="sref">s3me="L81">3  81{
mutex_unlo+pina      _irq_ess="s mutex_unlortcss="ssimple_strtoul( 14flagsa href="+code=smi_data_lock" class="sref">s3mf_handle3>buf;
s3msmi_data3ndle;
  79 14num_basksa hr144  14TIMEOUT_USEC_SHORT_SEMA_BLOCKING     return -)
 149md_dcdbusa hr144 mutex_unloPCAT_APM_STATUShPORTa hre/a>        if (3return 0;
  89      SM_STATUShCMD_UNSUCCESSFU9    b>        if (!  87
 14num_basksa hr-- return -)
 14num_basksa hr1444  114EI3NVAL;
 1143>  90

);
s3"sref">ha3uf) {
}
dev,
}
,
mutex_unlortcss="ssimple_strtoul( 14flagsa href="+code=smi_data_lock" class="sref">s3somment">3ize);
 142    physical smi_ess>class="line" name="L79">  79;
,                 >, a hro= uf="+code=dcdbasu8ref">mutex_unlou8e()ref="+code=mutex_unlock" clasa hrphys_smi_#37;lu\n",   983        }
mutex_unloindexa hr144  114
mutex_unloindexa hr1< uf="+code=dcdbasPE1400hCMOShCMD_STRUCT_PTR="L114"> 114s4e="L100">4100
mutex_unloindexa hr++le_strtoul(,                 >, a hr++b>        if (!)
, mutex_unloindexa hrt"ustore" class="sCMOShBASE_PORTref">mutex_unloCMOShBASE_PORT     + store" class="sCMOShPAGE1_INDEX_PORTref">mutex_unloCMOShPAGE1_INDEX_PORTa hreef="+code=smi_data_lock" class="sref">s4sme="L22"4e);
, ,                 >, a hrt"ustore" class="sCMOShBASE_PORTref">mutex_unloCMOShBASE_PORT     + store" class="sCMOShPAGE1_DATA_PORTref">mutex_unloCMOShPAGE1_DATA_PORTa hreef="+code=smi_data_lock" class="sref">s4s4e="L22"4ef) {

();
  794106
  55static unsigned int }

  89      SM_APM_CMDa hrle_strtoul(mutex_unloPCAT_APM_CONTROLhPORTa href="+code=smi_data_lock" class="sref">s4s="sref">4uf;
s4sref">han4le;
,   89      SM_APM_CMDa hrle_strtoul(mutex_unloPE1400hAPM_CONTROLhPORTa href="+code=smi_data_lock" class="sref">s4="sref">b4f);
s4ze;
class="line" name="L79">  794112
  89     CMOShREADta_bustore" class="sRTChREG_Css="sref">rets4=4e="L22"4/span>,
mutex_unlo+pina      _irq_ess="s mutex_unlortcss="ssimple_strtoul( 14flagsa href="+code=smi_data_lock" class="sref">s4ebuffer *4e);
4115
  794turn 0;
 149md_dcdbusa hr144 mutex_unloPE1400hAPM_CONTROLhPORTa href="+code=smi_data_lock" class="sref">s4=or use *417}
4118
  794ev,
 14num_basksa hr144  14TIMEOUT_USEC_SHORT_SEMA_BLOCKING     return -a4tr,
mutex_unloapm_cmda hra href="+code=dcdbasdcdbusname="L149"> 14dcdbusa hr1444   89      SM_STATUShCMD_UNSUCCESSFU9    b>        if (!4uf)
 14num_basksa hr-- return -422{
 14num_basksa hr1444  114);
 114 424}
4125
4ev,
,
4uf)
  94                dev_dbg(&dcdbasclass="line" name="L95">  95    invalid 42">e=ho  "%s: phys: %x size: %4="L129"> 429{
,  114           le_strtoul(  55static unsigned int );
 114 431}
4132
s4=_phys_ad4ev,
 4tr,
4nt)
436{
  77buf_s4ze;
  774et;
cass="line" name="L77">  774139
  ed by thesL77">  afLer thessystem hasass="line" name="L77">  77  77 4141
  774
,   77  77a4e);
  79dev_dbg        if (4et)
buf_s4et;
mutex_unloapm_cmda hrode=device_attribupm_cmdref">mutex_unloapm_cmda hrf="+code=smi_data_lock" class="sref">s4e="L148">4148
mutex_unlou8e0>, mutex_unloa +coda hrf="+code=smi_data_lock" class="sref">s4"sref">co4nt;
s4"a_buf_si450}
 a +codref">mutex_unlo name="L54"> a +codst_c1444  1144151
s4"="L132">4ock);
s4m_phys_ad4>  53
mutex_unloa +coda hr144  a +codref">mutex_unlo name="L54"> a +codst_cf="+code=smi_data_lock" class="sref">s4""sref">a4tion;
 a +codref">mutex_unlo name="L54"> a +codst_c144  114s4"_data_lo4type;
4down;
&q#37;lu\n",         if (!buf_s4>  57
  94                dev_dbg(&dcdbasclass="line" name="L95">  95    no142">/a>   class="string">&luf,  114           b    return /4**
s4data buff4er
 4*/
4/a>(void)
"%lu\n", mutex_unloapm_cmda hrss>        if (!4  62{
  94                dev_dbg(&dcdbasclass="line" name="L95">  95    42">/a>        ck>  class="string">"%s: phys: %x size: %4>smi_data4_buf)
 114           b    return s4d_data_lo4>  65
4;,
buf_s4ize);
mutex_unloapm_cmda hro= uf_size_store" class="sapm_cmdref">mutex_unloapm_cmda hrod)id="L101" class="liring">&q#37;lu\n", /4>  68
smi_data4_buf,
  79mutex_unloa +coda hr1     4  114        if (!;
mutex_unloapm_cmda hra href="+code=dcdbas claan/name="L149"> 149claan/st_c144  1144 = 0;
mutex_unloapm_cmda hra href="+code=dcdbasreservedref">mutex_unloreservedst_c1440 return - = 0;
mutex_unloapm_cmda hra href="+code=dcdbaspar"drtf="ref">mutex_unlopar"drtf="a hr."+code=simple_sshortreq5
mutex_unloparma hr[0])o= uf="+code=dcdbass115
 = 0;
}
mutex_unloa +coda hr1     4  114        if (!4**
mutex_unloapm_cmda hra href="+code=dcdbas claan/name="L149"> 149claan/st_c144  114buf_s4**
mutex_unloapm_cmda hra href="+code=dcdbasreservedref">mutex_unloreservedst_c1440 return -/4ed
mutex_unloapm_cmda hra href="+code=dcdbaspar"drtf="ref">mutex_unlopar"drtf="a hr."+code=simple_sshortreq5
mutex_unloparma hr[0])o= uf="+code=dcdbass115
 4*/
4size)
4  81{
buf;
s4msmi_data4ndle;
  77  77)
  794return 0;
dev_dbgmutex_unlonotifier_bs="sa hrode=device_attribnbine" name="L146nbta_b,137" id="L137" class="line" nae" nname="L149"> 149cd"+cod"%s: phys: %x size: %4ame="L87"4>  87
mutex_unlounused    breturn -)
EI4NVAL;
 149cd"+codb>        if (!4>  90
 14SYS_DOWN/dcd:       if (!
mutex_unloSYS_HALT/dcd:       if (!);
 114) {
 on_shutLown               int dev,
  79,
mutex_unloprc#Lsta_bu4" id="L80" claKERN_WARNINGname="L149"> 14KERN_WARNINGe0ass="line" name="L95">  95Please wait a>ne" name="L79">  794ize);
  95a +cod     clplrtf...class="string">b    return ;
dev_dbg
5100
)
);
 114) {
,
();
mutex_unlonotifier_bs="sa hro0" id="L80" cla_dbg5106
  ref">mutex_unlonotifier_c>  st_c144 dev_dbg
  89     NUL9ta_b"%s: phys: %x size: %5f9r use *5<       }
devpriorityst_c144  14INT_MIN/dcdbas.c#L125" id="L125" class="line" na5sref">han5le;
b5f);
s5ze;
 14DCDBAS_BIN_ATTR_RWta_bu4" id="L80" cla/span>, #37;lu\n",     b    return 5112
s5=4e="L22"5/span>,
 14bin_atme=butna hrode=device_attrib_dbgmutex_unlo_dbg);
, #37;lu\n", ta_b"%s: phys: %x size: %5e="L115">5115
  89     NUL9ta_bquot;%s: phys: %x size: %5e="L106">5turn 0;
}
5118
 14DCDBAS_DEV_ATTR_RWta_bu4" id="L80" cla/span>, ">"%lu\n", 5ev,
 14DCDBAS_DEV_ATTR_ROta_bu4" id="L80" cla/span>, ">&quphys_smi_#37;lu\n", b5tr,
 14DCDBAS_DEV_ATTR_WOta_bu4" id="L80" cla/sparequest               +codrequestta_bef="+code=smi_data_lock" class="sref">s5s="sref">5uf)
 14DCDBAS_DEV_ATTR_RWta_bu4" id="L80" cla name="L54"> a +codref">mutex_unlo name="L54"> a +codst_cef="+code=smi_data_lock" class="sref">s5s="L112">522{
 14DCDBAS_DEV_ATTR_RWta_bu4" id="L80" cla name="L54">  55static unsigned int );
 14DCDBAS_DEV_ATTR_RWta_bu4" id="L80" cla name="L54"> on_shutLown               int }
5125
 14atme=butna hrode=device_attrib_dbg  atme"ref">mutex_unlo_dbg  atme"a hr[]144        if (!5ev,
  atme_/span>, ">"%lu\n"  atme_/span>, ">"&a hr."+code=simple_satmename="L149"> 14atmeta_b"%s: phys: %x size: %5=or use *5tr,
  atme_/span>, ">&quphys_smi_#37;lu\n"  atme_/span>, ">&quphys_smi_a hr."+code=simple_satmename="L149"> 14atmeta_b"%s: phys: %x size: %5=="sref">5uf)
  atme_/sparequest               a>  atme_/sparequesta hr."+code=simple_satmename="L149"> 14atmeta_b"%s: phys: %x size: %5="L129"> 529{
  atme_ name="L54"> a +codref">mutex_unloa>  atme_ name="L54"> a +coda hr."+code=simple_satmename="L149"> 14atmeta_b"%s: phys: %x size: %5="sref">b5e);
  atme_ name="L54">  55static unsigned a>  atme_ name="L54">  55sa hr."+code=simple_satmename="L149"> 14atmeta_b"%s: phys: %x size: %5=="sref">531}
  atme_ name="L54"> on_shutLown               a>  atme_ name="L54"> on_shutLowna hr."+code=simple_satmename="L149"> 14atmeta_b"%s: phys: %x size: %5=="L112">5132
  89     NUL9ta_bquot;%s: phys: %x size: %5=_phys_ad5ev,
 5tr,
5nt)
 14atme=butn_groupa hro0" id="L80" cla_dbg 14_dbg536{
mutex_unloatme"a hr144 mutex_unlo_dbg  atme"a hr"%s: phys: %x size: %5=or use *5ze;
5et;
5139
 initref">mutex_unlo_aa> inita hro0" id="L80" cla_dbgdcdbabreturn -, 10);
 5141
 14erroe     return -5
s5e_phys_ad5k);
 a +codref">mutex_unlo name="L54"> a +codst_c144  114s5e"sref">a5e);
  55static unsigned int  114s5e="L115">5k);
5et)
ne" name="L79">  79buf_s5et;
c>  s require>/a>    smi_esses bec0# 32-bit ami_ess>cdbce.ass="line" name="L77">  775148
        * This is done by sett="L1thesDMA mask below.ass="line" name="L77">  77co5nt;
  79}
s5e="L115">5k);hret2d_">5139
    cla_db_dma_ss="ref="+codeHC_42"TYPE_ND    IT_MASK 14DCDBAS_DEV_AT    IT_MASKstore32
5k);hret2d_">5139
  dma_ss="ref="+cf="+code=dev_dbg" class="sref">dev_dbg(&dcdbasclass="lineta hro0" id="L80" cla_db_dma_ss=" 149cd"+codb>    cla_db_dma_ss="ref=a href="+code=count" class5fbuffer *5241pan>
s4m_phys_ad4>5 53
<5 href="drive4rs/fi45e/dc5bas.c5L10>, m149"> 14erroe     return - 14atme=butn_grsysfs_crea="L149">storeutex_unla>  atme_ name=ref">dcdbasclass="linee=dcdbas_pdev" class="sref">dcdbasclass="lineta hro0" id="L80kobjref">dcdbasclaskobj"L80" f="+code=dev_dbg" class="srme="L149"> 14_dbg);
149"> 14erroe     return -,pe;
<5 href="drive4rs/fi45e/dc5bas.c55c#L96" id20" id="4" i" class="lNOTIFY_DONE=149"> 14erroe     return -5;
<5 href="drive4rs/fi45e/dc5bas.c55c#L57" id="L57" class="line" n4df">buf_s4i5 57
<5 href="drive4rs/fi45e/dc5bas.c5L128" id="ufmut   ita_b,10" id="L80-5k);hret2d_">51">mutex_unlo_dbgmut   ita_b,10" id="L80]h85">5k);hrett   ita_b,10" id="L80if (!
<5 href="drive4rs/fi45ware5dcdba5.c#L89" id="L89"f="+coassa +codref">m149"> 14erroe     return -  atme_ name=ref">dcdbasclass="linee=dcdbas_pdev" class="sref">dcdbasclass="lineta hro0" id="L80kobjref">dcdbasclaskobj"L80"
<5 href="drive4rs/fi46e/dc5bas.c56120" id="L120" class="lin="L89" classid="L89"f="+coassa +codref">m2d_">51">mutex_unlo_dbgmut   ita_b,10" id="L80]
<5 href="drive4rs/fi46e/dc5retur56121" id="="L89" class" class name="L54">149"> 14erroe     return -(void)
<5 href="drive4rs/fi46ware5dcdba56102" id="20" id="0" id="L80" ref="+c- name="SYS="L114t   ita_b,10" id="L80-=dcd,62{
<5 href="drive4rs/fi463/dc5bas.c5L147" id="ltore" classssid="L89"f="+coassa +codref">mrysfs_remov"Lr[]1filot;,   atme_ name=ref">dcdbasclass="linee=dcdbas_pdev" class="sref">dcdbasclass="lineta hro0" id="L80kobjref">dcdbasclaskobj"L80"
<5 href="drive4rs/fi46ware5dcdba5.c#L94" id47" id="ltore" class"lin="L89" classid="L89"f="+coassa +codref">m2d_">51">mutex_unlo_dbgmut   ita_b,10" id="L80]);
mrysfs_remov"L149"> 14atme=butn_grsysfs_remov"L149">storeutex_unla>  atme_ name=ref">dcdbasclass="linee=dcdbas_pdev" class="sref">dcdbasclass="lineta hro0" id="L80kobjref">dcdbasclaskobj"L80" f="+code=dev_dbg" class="srme="L149"> 14_dbg
<5 href="drive4rs/fi46ware5dcdba56c#L96" id20" id="4" id="L80" " class="lNOTIFY_DONE=149"> 14erroe     return -5,
<5 href="drive4rs/fi46ware5dcdba56127" id="5" id="20" i" id="L75" class="line" na5s5e="L22"5ede);
<5 href="drive4rs/fi46e/dc5bas.c5L1store" class" id="L75" class="line" na5s5e="L22"5ede/span>
<5 href="drive4rs/fi46e/dc5bas.c5L139" id="L139" class="line" na4>smi_data4_5uf,
<5 href="drive4rs/fi47e/dc5bas.c5L10ass="line" n"lNOTIFY_DONE=registerfyta_b"&ie> 14erroe     reregisterfyta_b"&ie>storeutex_unla>  atme_ nam_nbine" name="L146_dbg);
<5 href="drive4rs/fi47e/dc5bas.c57-s5zeLL;
<5 href="drive4rs/fi47e/dc5bas.c57102" id="="L85">5k);hret2ev_info   a>  atme_ name="infostoreutex_unla>  atme_ name=ref">dcdbasclass="linee=dcdbas_pdev" class="sref">dcdbasclass="line" name="L95">  95    42">/a>    (NVALrtf./a>   )g">"%s: phys: %x size: %4>smi_data4_5a> = 0;
<5 href="drive4rs/fi473/dc5bas.c5L147" id=" 
<5 href="drive4rs/fi47ware5dcdba5.c#L94 href="+code=count" class5fbuffer *524ea>);
smi_data4_5uf<"52a>  atme_ name=ref">dcdb#L157" id57="L57" class="line" n4df">buf_s4i5 57
 initref">mutex_unlo_aex inita hro0" id="L80" ex idbgstoareboot_nbst_c144       >stoass="splatformaa> icstatic unsigned platformaa> icsa hrode=device_attrib_pdev" class="sref">dcdbabreturn -, 10);
EI4NVAL;
5a href="d5ive4rs/fi48e/dcdbas.c#L150" id5"4" id="L80" c              ita_b,10" id="L80" claerrois5zeLL;
5k);hret2ev_info unyta_b"&ie> 14erroe     reregisterfunyta_b"&ie> 14erroe _unla>  atme_ nam_nbine" name="L146_dbg);
mut   ita_b,10" id="L80-5k);hret2d_">51">mutex_unlo_dbgmut   ita_b,10" id="L80]h85">5k);hrett   ita_b,10" id="L80if (!);
,   atme_ name=ref">dcdbasclass="linee=dcdbas_pdev" class="sref">dcdbasclass="lineta hro0" id="L80kobjref">dcdbasclaskobj"L80"m2d_">51">mutex_unlo_dbgmut   ita_b,10" id="L80]);
  55sov"L149"> 14atme=butn_grsysfs_remov"L149">storeutex_unla>  atme_ name=ref">dcdbasclass="linee=dcdbas_pdev" class="sref">dcdbasclass="lineta hro0" id="L80kobjref">dcdbasclaskobj"L80" f="+code=dev_dbg" class="srme="L149"> 14_dbg
5et)
smi_data4_a href="d5ive4rs/fi48ware/        5f (!<58L139" class="line" na4>smi_data4_5uf,
 icstatic unsigned pe" narmaa> icsa hrode=device_ae" nadbg icsa hrodigned ape" na85">5k<"+code=buf" class4"sref">EI4NVAL;
5a href="d5ive4rs/fi49e/dcdbas.c#L15ase i5="L101" classSid="L80dma_ss=" 1e" narmaa> icsa hrodie" na85">555555555k<"+code=buf" class4"sref">EI4NVAL;
5a href="d5ive4rs/fi49e/dcdbas.c#L15ase i5920" id="0" id="L80" r              nexs.crmaa> icsa hrodxs.c0" id="2"TYPE_ND    IT_MASf="  NAE     return -
 icsa hrodownna

devg  atme"ref">mutex_udbg
d9">stoareboot_nbst_c1  >stoass=codeHC_42  atme"ref">L80" ex i_/aatme_groupst_cL80" ex i_/_unlaaprobstatic unsigned a9">stoareboot_nbst_c144       >stoass=)"+code=buf" class4smi_data_4u5<53
}
5118
        * This is do77">  77  44     cla_reass="le" naie" na85 77  79}
 initref">mutex_unla> inita hro0" id="L8cla_dbg inita hro0" id="igned aa> i_unla href="+code=ret" cla4s="sref">4et)
EI4NVAL;
6a href="d6ive5firmw50ware/dcdbas.c6L75" 60#L88id="L101"a> initref">mutex_urroe     return -5,
6a href="d6ive5firmw50e/dcdbas.c#L165" id6"L125" class="line" na5a_buf_fre5();
  89     NUrroe     return - icsa hrode=device_ae" na_yta_b&qu_unla>  atme_ nam_nbine" name="Lpe" narmaa> icsa hrodigned ape" na85">+code=count" class5fbuffer *524 65
6href="dri6ers5firmw50e/dcdbas.c#L16"+cod60="L93" class="lir"L54">149"> 14erroe     return -,pe;
6href="dri6ers5firmw50e/dcdbas.c#L16"+cod6020" id="4" id="L80" clNOTIFY_DONE=149"> 14erroe     return -5,
6a href="d6ive5firmw50ware/dcdbas.c6"+cod60L139" class="line" na4>smi_data4_5uf,
6href="dri6ers5firmw51e/dcd} return6-dev_dbg(& icsa hrode=device_attrib_alloc_unlaaprobstatic unsASf="  NAE     return -
6href="dri6ers5firmw51e/dcdreturn -6a hre61L101" classa +coding">&q#37;lu\n&">dev_dbg(&(void)
6href="dri6ers5firmw51e/dcddcdbas. 6a hre61 mutex_unlrroe     return - 1145,
6href="dri6ers5firmw51ware/="+code=6mi_da61 mutex_unlrro_unyta_b&quope" narmaa> icsa hrodrro_unyta_b&quope" na"+code=EINVAL" class=5e="L132">5,
6h href="d6ers5firmw51ware/dcdbas.f6size_61#L88id="L101"}e=EINVAL" class=5e="L132">5,
6h href="d6ers5firmw51e/dcdbas.c#L16ef="+61L125" class="line" na5a_buf_fre5();
  89     NUrroe     return -(&5,
6href="dri6ers5firmw51e/dcd} return6-149"> 14erroe     return -,pe;
6href="dri6ers5firmw51e/dcdbas.c#L168" id6120" id="4" id="L80" cgotomdref">mutex_unlrro_free platformaa> icsa hrodrro_free platfo"+code=EINVAL" class=5e="L132">5,
6h href="d6ers5firmw51ware/dcdbas. 6a hre61L139" class="line" na4>smi_data4_5uf,
6href="dri6ers5firmw520are/dcdbas. 6a hre62ne" n"lNOTIFYRSf="   is5zeLL;
6href="dri6ers5firmw52e/dcddcdbas. 6a hre6="+codmdref">mutex_unlrro_free platformaa> icsa hrodrro_free platfo"+co"+code=buf" class4ssmi_data4uf) {
6href="dri6ers5firmw523/dcddcdbas. 6a hre62="L66" NUL9">  89     NUe=device_attrib_puinita hro0" id="e=device_attrib_pui_unlaaprobstatic unsigned abg(&5,
6href="dri6ers5firmw524/dcddcdbas. 6a hre6="+codmdref">mutex_unlrro_unyta_b&quope" narmaa> icsa hrodrro_unyta_b&quope" na"+co"+code=buf" class4ssmi_data4uf) {
6h href="d6ers5firmw52e/dcdbas.c#L165" id62L145" c name="L54">  55se=device_ae" na_unyta_b&qurmaa> icsa hrode=device_ae" na_unyta_b&qu_unla>  atme_ nam_nbine" name="Lpe" narmaa> icsa hrodigned ape" na85">+code=count" class5fbuffer *524 65
6href="dri6ers5firmw52ware/dcdbas.f6size_626e" n"lNOTIFYRSf="  _DONE=149"> 14erroe     return -5,
6href="dri6ers5firmw527/dcdbas.c#L16ef="+6ode=mu}e=EINVAL" class=5e="L132">5,
6href="dri6ers5firmw5re/dcdbas.c#L16ef="+62L148" class="line" na5=="sref">5118
        * This is do77">  77  44     ex i: a +cod cass="chiseanhref 77  79}
4et)
EI4NVAL;
6href="dri6ers5firmw5re/dcd} return6-ne" name="L79">  79buf_s5et;
buf_s5et;
buf_s5et;
  79}
mutex_unlunyta_b"&ie> 14erroe     reregisterfunyta_b"&ie> 14erroe _unla>  atme_ nam_nbine" name="L146_dbg);
6href="dri6ers5firmw53e/dcdbas.c#L169" id6"L139" class="line" na5e="L139">5139
}
}
}
}
,   77co5nt;
  79}
  89     NU_a hr."+code=freeutn_grsysfs_remoa hr."+code=free_unla+code=count" class5fbuffer *524e);
6href="dri6ers5firmw54e/dcdbas.c#L16ass="6ine" n class="l 89     NUe=device_attrib_unyta_b&qurmaa> icsa hrode=device_attrib_unyta_b&qu_unlaaprobstatic unsigned abg(&5,
6href="dri6ers5firmw54e/dcddcdbas.c6L79" 64lass="sapm_cmdref">mutex_unle=device_ae" na_unyta_b&qurmaa> icsa hrode=device_ae" na_unyta_b&qu_unla>  atme_ nam_nbine" name="Lpe" narmaa> icsa hrodigned ape" na85">+code=count" class5fbuffer *524 65
6href="dri6ers5firmw54ware/dcdbas.c6L77" 6d="L77}e=EINVAL" class=5e="L132">5,
6href="dri6ers5firmw55ware/dcdbas.c6L78" 6d="L78e=EINVAL" class=5e="L132">5,
6href="dri6ers5de=bu55e/dcdbas.c#L16f">s56="L115me_ nam_nbine" moduleaa> inita hro0" id="moduleaa> i_unlaaprobstatic unsigned aa> inita hro0" id="igned aa> i_unl+code=count" class5fbuffer *524 65
65ref="dri6ers4firmw45e/dc5bas.c5L162" id6"="L85me_ nam_nbine" moduleaex inita hro0" id="moduleaex i_unlaaprobstatic unsigned aex inita hro0" id="igned aex i_unl+code=count" class5fbuffer *524 65
65ref="dri6ive4rs/fi45ware5="+co5e=6mi_da6a_lock" class="sref">s4m_phys_ad4>5 53
65 href="d6ive4rs/fi45e/dc5bas.c5L16>,   95    42">/a>    (N./a>   )g">7;s: phys: &name="LTRIVER_VERSf=" 14DCDBAS_DEV_ATRIVER_VERSf="   i  95    42">/a>    (N)urn ;
6h href="d6ive4rs/fi45e/dc5bas.c5L165" id6"L145"aprobstatic unsMODUAPf4DCDBAS_DEV_ATRIVER_VEMODUAPf4DCDBAS_unlaaprobstatic unsASf="  4DCDBAS_DEV_ATRIVER_VERSf="   i
65 href="d6ive4rs/fi45e/dc5bas.c55c6L96" 6d20" iaprobstatic unsMODUAPfAUTHOR_DEV_ATRIVER_VEMODUAPfAUTHOR_unlaa>  95    42">/a>    (NDei_ Inc.urn ;
6href="dri6ive4rs/fi45e/dc5bas.c55c6L57" 6d="L57aprobstatic unsMODUAPfLICENS     return -  95    42">/a>    (NGPLurn ;
6href="dri6ive4rs/fi45e/dc5bas.c5L168" id65="L79"         * BIOS 42">c/* Any Syb&qm orre>/a>   im  79}
/a>    (Ndmi:*:[bs]vnD[Ee][Ll][Ll]*:*urn ;
65 href="d6ive4rs/fi46e/dc5bas.c56160" id6"L120"


T="lorigLXR IOS uncodeINT, tL1thexperi 42"al a> )g"sk de=count"mailto:lxa@e/dux.no">lxa@e/dux.noeINT.
lxa.e/dux.no kindlybst_ced"sk de=count"http://www.redpill-e/dpro.no">Redpill L/dpro AS_unl, provid-biof:L/dux="lisulow.asand opera+cods -