Changeset 479 for GPL/trunk/lib32/ioctl.c
- Timestamp:
- May 1, 2010, 9:49:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/lib32/ioctl.c
r470 r479 38 38 int pcm_instances(int card_id); 39 39 40 intuniaud_set_interrupted_substream(struct snd_pcm_substream *substream)40 void uniaud_set_interrupted_substream(struct snd_pcm_substream *substream) 41 41 { 42 42 int i; … … 257 257 } 258 258 return max_ch; 259 }260 261 void FillCaps(ULONG deviceid)262 {263 int pcms = 0;264 265 pcms = pcm_instances(deviceid);266 267 printk("pcms = %i\n", pcms); //uncommented268 if (!pcmcaps[deviceid])269 {270 pcmcaps[deviceid] = (POSS32_DEVCAPS)kmalloc(sizeof(OSS32_DEVCAPS)*pcms, GFP_KERNEL);271 if (pcmcaps[deviceid])272 {273 memset(pcmcaps[deviceid], 0, sizeof(OSS32_DEVCAPS)*pcms);274 GetUniaudPcmCaps1(deviceid, (void *)pcmcaps[deviceid]);275 }276 }277 return;278 }279 280 int GetUniaudPcmCaps(ULONG deviceid, void *caps)281 {282 int pcms = 0;283 284 pcms = pcm_instances(deviceid);285 286 // printk("pcms = %i\n", pcms);287 if (pcmcaps[deviceid])288 {289 memcpy((unsigned char*)caps,(unsigned char*)pcmcaps[deviceid],sizeof(OSS32_DEVCAPS)*pcms);290 return 0;291 }292 else293 {294 return -1;295 }296 259 } 297 260 … … 316 279 if (!pcaps || !pcms) return -1; 317 280 318 281 319 282 //these structures are too big to put on the stack 320 283 pcminfo = (struct snd_pcm_info *)kmalloc(sizeof(struct snd_pcm_info)+sizeof(struct snd_pcm_hw_params), GFP_KERNEL); … … 434 397 } 435 398 399 void FillCaps(ULONG deviceid) 400 { 401 int pcms = 0; 402 403 pcms = pcm_instances(deviceid); 404 405 printk("pcms = %i\n", pcms); //uncommented 406 if (!pcmcaps[deviceid]) 407 { 408 pcmcaps[deviceid] = (POSS32_DEVCAPS)kmalloc(sizeof(OSS32_DEVCAPS)*pcms, GFP_KERNEL); 409 if (pcmcaps[deviceid]) 410 { 411 memset(pcmcaps[deviceid], 0, sizeof(OSS32_DEVCAPS)*pcms); 412 GetUniaudPcmCaps1(deviceid, (void *)pcmcaps[deviceid]); 413 } 414 } 415 return; 416 } 417 418 int GetUniaudPcmCaps(ULONG deviceid, void *caps) 419 { 420 int pcms = 0; 421 422 pcms = pcm_instances(deviceid); 423 424 // printk("pcms = %i\n", pcms); 425 if (pcmcaps[deviceid]) 426 { 427 memcpy((unsigned char*)caps,(unsigned char*)pcmcaps[deviceid],sizeof(OSS32_DEVCAPS)*pcms); 428 return 0; 429 } 430 else 431 { 432 return -1; 433 } 434 } 435 436 436 /* 437 437 returns power state of given card … … 469 469 } 470 470 //retrieve mixer information 471 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 472 SNDRV_CTL_IOCTL_POWER_STATE, 471 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 472 SNDRV_CTL_IOCTL_POWER_STATE, 473 473 (ULONG)state); 474 474 … … 522 522 } 523 523 //retrieve mixer information 524 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 525 SNDRV_CTL_IOCTL_POWER, 524 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 525 SNDRV_CTL_IOCTL_POWER, 526 526 (ULONG)state); 527 527 … … 576 576 } 577 577 //retrieve mixer information 578 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 579 SNDRV_CTL_IOCTL_CARD_INFO, 578 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 579 SNDRV_CTL_IOCTL_CARD_INFO, 580 580 (ULONG)(struct snd_ctl_card_info *)info); 581 581 if(ret) { … … 630 630 } 631 631 //retrieve mixer information 632 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 633 SNDRV_CTL_IOCTL_CARD_INFO, 632 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 633 SNDRV_CTL_IOCTL_CARD_INFO, 634 634 (ULONG)&pHandle->info); 635 635 if(ret) { … … 640 640 pHandle->list.offset = 0; 641 641 pHandle->list.space = 0; 642 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 643 SNDRV_CTL_IOCTL_ELEM_LIST, 642 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 643 SNDRV_CTL_IOCTL_ELEM_LIST, 644 644 (ULONG)&pHandle->list); 645 645 if(ret) { … … 695 695 } 696 696 //retrieve mixer information 697 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 698 SNDRV_CTL_IOCTL_CARD_INFO, 697 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 698 SNDRV_CTL_IOCTL_CARD_INFO, 699 699 (ULONG)&pHandle->info); 700 700 if(ret) { … … 705 705 pHandle->list.offset = 0; 706 706 pHandle->list.space = 0; 707 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 708 SNDRV_CTL_IOCTL_ELEM_LIST, 707 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 708 SNDRV_CTL_IOCTL_ELEM_LIST, 709 709 (ULONG)&pHandle->list); 710 710 if(ret) { … … 724 724 pHandle->list.space = pHandle->list.count; 725 725 pHandle->list.pids = pHandle->pids; 726 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 727 SNDRV_CTL_IOCTL_ELEM_LIST, 726 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 727 SNDRV_CTL_IOCTL_ELEM_LIST, 728 728 (ULONG)&pHandle->list); 729 729 if(ret) {
Note:
See TracChangeset
for help on using the changeset viewer.