dsp56k.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) dsp56k.c (496ad9aa8ef448058e36ca7a787c61f2e63f0f54)
1/*
2 * The DSP56001 Device Driver, saviour of the Free World(tm)
3 *
4 * Authors: Fredrik Noring <noring@nocrew.org>
5 * lars brinkhoff <lars@nocrew.org>
6 * Tomas Berndtsson <tomas@nocrew.org>
7 *
8 * First version May 1996

--- 167 unchanged lines hidden (view full) ---

176 dsp56k_host_interface.data.l = 3; /* Magic execute */
177
178 return 0;
179}
180
181static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
182 loff_t *ppos)
183{
1/*
2 * The DSP56001 Device Driver, saviour of the Free World(tm)
3 *
4 * Authors: Fredrik Noring <noring@nocrew.org>
5 * lars brinkhoff <lars@nocrew.org>
6 * Tomas Berndtsson <tomas@nocrew.org>
7 *
8 * First version May 1996

--- 167 unchanged lines hidden (view full) ---

176 dsp56k_host_interface.data.l = 3; /* Magic execute */
177
178 return 0;
179}
180
181static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
182 loff_t *ppos)
183{
184 struct inode *inode = file->f_path.dentry->d_inode;
184 struct inode *inode = file_inode(file);
185 int dev = iminor(inode) & 0x0f;
186
187 switch(dev)
188 {
189 case DSP56K_DEV_56001:
190 {
191
192 long n;

--- 46 unchanged lines hidden (view full) ---

239 printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
240 return -ENXIO;
241 }
242}
243
244static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
245 loff_t *ppos)
246{
185 int dev = iminor(inode) & 0x0f;
186
187 switch(dev)
188 {
189 case DSP56K_DEV_56001:
190 {
191
192 long n;

--- 46 unchanged lines hidden (view full) ---

239 printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
240 return -ENXIO;
241 }
242}
243
244static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
245 loff_t *ppos)
246{
247 struct inode *inode = file->f_path.dentry->d_inode;
247 struct inode *inode = file_inode(file);
248 int dev = iminor(inode) & 0x0f;
249
250 switch(dev)
251 {
252 case DSP56K_DEV_56001:
253 {
254 long n;
255

--- 45 unchanged lines hidden (view full) ---

301 printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
302 return -ENXIO;
303 }
304}
305
306static long dsp56k_ioctl(struct file *file, unsigned int cmd,
307 unsigned long arg)
308{
248 int dev = iminor(inode) & 0x0f;
249
250 switch(dev)
251 {
252 case DSP56K_DEV_56001:
253 {
254 long n;
255

--- 45 unchanged lines hidden (view full) ---

301 printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
302 return -ENXIO;
303 }
304}
305
306static long dsp56k_ioctl(struct file *file, unsigned int cmd,
307 unsigned long arg)
308{
309 int dev = iminor(file->f_path.dentry->d_inode) & 0x0f;
309 int dev = iminor(file_inode(file)) & 0x0f;
310 void __user *argp = (void __user *)arg;
311
312 switch(dev)
313 {
314 case DSP56K_DEV_56001:
315
316 switch(cmd) {
317 case DSP56K_UPLOAD:

--- 85 unchanged lines hidden (view full) ---

403
404/* As of 2.1.26 this should be dsp56k_poll,
405 * but how do I then check device minor number?
406 * Do I need this function at all???
407 */
408#if 0
409static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
410{
310 void __user *argp = (void __user *)arg;
311
312 switch(dev)
313 {
314 case DSP56K_DEV_56001:
315
316 switch(cmd) {
317 case DSP56K_UPLOAD:

--- 85 unchanged lines hidden (view full) ---

403
404/* As of 2.1.26 this should be dsp56k_poll,
405 * but how do I then check device minor number?
406 * Do I need this function at all???
407 */
408#if 0
409static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
410{
411 int dev = iminor(file->f_path.dentry->d_inode) & 0x0f;
411 int dev = iminor(file_inode(file)) & 0x0f;
412
413 switch(dev)
414 {
415 case DSP56K_DEV_56001:
416 /* poll_wait(file, ???, wait); */
417 return POLLIN | POLLRDNORM | POLLOUT;
418
419 default:

--- 115 unchanged lines hidden ---
412
413 switch(dev)
414 {
415 case DSP56K_DEV_56001:
416 /* poll_wait(file, ???, wait); */
417 return POLLIN | POLLRDNORM | POLLOUT;
418
419 default:

--- 115 unchanged lines hidden ---