Ignore:
Timestamp:
Mar 24, 2008, 2:43:42 AM (17 years ago)
Author:
Paul Smedley
Message:

Update source to ALSA 1.0.16 level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud-2.0/lib32/ioctl.c

    r111 r305  
    66 */
    77
    8 #include <sound/driver.h>
     8#include <sound/core.h>
    99#include <sound/control.h>
    1010#include <sound/info.h>
     
    2929 * set by snd_ctl_notify()
    3030 */
    31 snd_pcm_substream_t *substream_int[8*256] = {0}; // interrupted substream
     31struct snd_pcm_substream *substream_int[8*256] = {0}; // interrupted substream
    3232int control_id_changed = 0;
    3333int card_id_changed = 0;
     
    7171    int i = 0;
    7272    int j = 0;
    73     snd_pcm_file_t *pcm_file = NULL;
    74     snd_pcm_substream_t *substream;
    75     snd_pcm_runtime_t *runtime;
     73    struct snd_pcm_file *pcm_file = NULL;
     74    struct snd_pcm_substream *substream;
     75    struct snd_pcm_runtime *runtime;
    7676    soundhandle        *pHandle = (soundhandle *)handle;
    7777    struct file *pfile;
     
    8585        return -ENXIO;
    8686
    87     pcm_file = (snd_pcm_file_t *)pfile->private_data;
     87    pcm_file = (struct snd_pcm_file *)pfile->private_data;
    8888
    8989    if (pcm_file == NULL)
     
    284284    OSSSTREAMID          streamid = 0;
    285285    soundhandle         *pHandle;
    286     snd_pcm_info_t      *pcminfo = NULL;
    287     snd_pcm_hw_params_t *params;
     286    struct snd_pcm_info      *pcminfo = NULL;
     287    struct snd_pcm_hw_params *params;
    288288    int                  ret, fmt, j;
    289289    ULONG                format_mask;
    290     snd_mask_t           *mask;
     290    struct snd_mask           *mask;
    291291    int pcms = 0;
    292292
     
    297297   
    298298    //these structures are too big to put on the stack
    299     pcminfo = (snd_pcm_info_t *)kmalloc(sizeof(snd_pcm_info_t)+sizeof(snd_pcm_hw_params_t), GFP_KERNEL);
     299    pcminfo = (struct snd_pcm_info *)kmalloc(sizeof(struct snd_pcm_info)+sizeof(struct snd_pcm_hw_params), GFP_KERNEL);
    300300    if(pcminfo == NULL) {
    301301        DebugInt3();
     
    303303        return OSSERR_OUT_OF_MEMORY;
    304304    }
    305     params = (snd_pcm_hw_params_t *)(pcminfo+1);
     305    params = (struct snd_pcm_hw_params *)(pcminfo+1);
    306306
    307307    for (i=0; i<pcms;i++)
     
    383383            pWaveCaps->ulMaxRate     = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->max;
    384384
    385             mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_RATE_MASK);
     385//            mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_RATE_MASK);
     386            mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
    386387            pWaveCaps->ulRateFlags   = mask->bits[0];
    387388
     
    525526    mixerhandle *pHandle = NULL;
    526527    int          ret, i, j;
    527 //    snd_ctl_card_info_t *pinfo;
     528//    struct snd_ctl_card_info *pinfo;
    528529
    529530    if(alsa_fops == NULL) {
     
    556557    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file,
    557558                                    SNDRV_CTL_IOCTL_CARD_INFO,
    558                                     (ULONG)(snd_ctl_card_info_t *)info);
     559                                    (ULONG)(struct snd_ctl_card_info *)info);
    559560    if(ret) {
    560561        ret = pHandle->file.f_op->release(&pHandle->inode, &pHandle->file);
     
    692693
    693694    //allocate memory for all mixer elements
    694     pHandle->pids = (snd_ctl_elem_id_t *)pids;
    695         //kmalloc(sizeof(snd_ctl_elem_id_t)*pHandle->list.count, GFP_KERNEL);
     695    pHandle->pids = (struct snd_ctl_elem_id *)pids;
     696        //kmalloc(sizeof(struct snd_ctl_elem_id)*pHandle->list.count, GFP_KERNEL);
    696697    if(pHandle->pids == NULL) {
    697698        ret = pHandle->file.f_op->release(&pHandle->inode, &pHandle->file);
     
    711712//    if (pids)
    712713//        memcpy(pids, pHandle->pids,
    713 //               sizeof(snd_ctl_elem_id_t)*pHandle->list.count);
     714//               sizeof(struct snd_ctl_elem_id)*pHandle->list.count);
    714715
    715716    ret = pHandle->file.f_op->release(&pHandle->inode, &pHandle->file);
     
    730731int GetUniaudControlInfo(ULONG deviceid, ULONG id, void *info)
    731732{
    732     snd_ctl_elem_value_t *pElem = NULL;
    733     snd_ctl_elem_info_t  *pElemInfo = NULL;
     733    struct snd_ctl_elem_value *pElem = NULL;
     734    struct snd_ctl_elem_info  *pElemInfo = NULL;
    734735    mixerhandle *pHandle = NULL;
    735736    int          ret, i, j, sz;
     
    764765
    765766    //allocate memory for info element
    766     pElemInfo = (snd_ctl_elem_info_t *)info;
     767    pElemInfo = (struct snd_ctl_elem_info *)info;
    767768    if(pElemInfo == NULL) {
    768769        ret = pHandle->file.f_op->release(&pHandle->inode, &pHandle->file);
     
    770771    }
    771772
    772 //    printk("sizeof elem_info %i\n",sizeof(snd_ctl_elem_info_t));
     773//    printk("sizeof elem_info %i\n",sizeof(struct snd_ctl_elem_info));
    773774
    774775    pElemInfo->id.numid = id;
     
    789790int GetUniaudControlValueGet(ULONG deviceid, ULONG id, void *value)
    790791{
    791     snd_ctl_elem_value_t *pElem = NULL;
    792     snd_ctl_elem_info_t  *pElemInfo = NULL;
     792    struct snd_ctl_elem_value *pElem = NULL;
     793    struct snd_ctl_elem_info  *pElemInfo = NULL;
    793794    mixerhandle *pHandle = NULL;
    794795    int          ret, i, j, sz;
     
    822823    }
    823824
    824     pElem = (snd_ctl_elem_value_t *)value;
     825    pElem = (struct snd_ctl_elem_value *)value;
    825826    if(pElem == NULL) {
    826827        ret = pHandle->file.f_op->release(&pHandle->inode, &pHandle->file);
     
    828829    }
    829830
    830 //    printk("sizeof elem_info %i\n",sizeof(snd_ctl_elem_info_t));
     831//    printk("sizeof elem_info %i\n",sizeof(struct snd_ctl_elem_info));
    831832
    832833    pElem->id.numid = id;
     
    847848int GetUniaudControlValuePut(ULONG deviceid, ULONG id, void *value)
    848849{
    849     snd_ctl_elem_value_t *pElem = NULL;
    850     snd_ctl_elem_info_t  *pElemInfo = NULL;
     850    struct snd_ctl_elem_value *pElem = NULL;
     851    struct snd_ctl_elem_info  *pElemInfo = NULL;
    851852    mixerhandle *pHandle = NULL;
    852853    int          ret, i, j, sz;
     
    880881    }
    881882
    882     pElem = (snd_ctl_elem_value_t *)value;
     883    pElem = (struct snd_ctl_elem_value *)value;
    883884    if(pElem == NULL) {
    884885        ret = pHandle->file.f_op->release(&pHandle->inode, &pHandle->file);
     
    886887    }
    887888
    888 //    printk("sizeof elem_info %i\n",sizeof(snd_ctl_elem_info_t));
     889//    printk("sizeof elem_info %i\n",sizeof(struct snd_ctl_elem_info));
    889890
    890891    pElem->id.numid = id;
     
    908909    int ret;
    909910    soundhandle        *pHandle = (soundhandle *)streamid;
    910     snd_pcm_hw_params_t *params = NULL;
    911 
    912     params = (snd_pcm_hw_params_t *)pHwParams;
     911    struct snd_pcm_hw_params *params = NULL;
     912
     913    params = (struct snd_pcm_hw_params *)pHwParams;
    913914
    914915    if (!params) return -1001;
     
    925926    int ret;
    926927    soundhandle        *pHandle = (soundhandle *)streamid;
    927     snd_pcm_hw_params_t *params = NULL;
    928 
    929     params = (snd_pcm_hw_params_t *)pHwParams;
     928    struct snd_pcm_hw_params *params = NULL;
     929
     930    params = (struct snd_pcm_hw_params *)pHwParams;
    930931
    931932    if (!params) return -1001;
     
    941942    int ret;
    942943    soundhandle        *pHandle = (soundhandle *)streamid;
    943     snd_pcm_sw_params_t *params = NULL;
    944 
    945     params = (snd_pcm_sw_params_t *)pSwParams;
     944    struct snd_pcm_sw_params *params = NULL;
     945
     946    params = (struct snd_pcm_sw_params *)pSwParams;
    946947
    947948    if (!params) return -1001;
     
    958959    int ret;
    959960    soundhandle        *pHandle = (soundhandle *)streamid;
    960     snd_pcm_status_t   *status = (snd_pcm_status_t *)pstatus;
     961    struct snd_pcm_status   *status = (struct snd_pcm_status *)pstatus;
    961962
    962963    if (!status) return -1001;
Note: See TracChangeset for help on using the changeset viewer.