|
From: Steve L. <slo...@us...> - 2001-08-23 17:10:46
|
Update of /cvsroot/linux-mips/linux/arch/mips/au1000/common
In directory usw-pr-cvs1:/tmp/cvs-serv24086/arch/mips/au1000/common
Modified Files:
dma.c usbdev.c
Log Message:
Renamed the Au1000 dma functions to not collide with kernel/dma.c.
Also, /proc/dma will show the output from kernel/dma.c:get_dma_list(),
not the Au1000 dma list. To fix requires a change to fs/proc/proc_misc.c.
Index: dma.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/common/dma.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** dma.c 2001/08/17 22:53:26 1.1
--- dma.c 2001/08/23 17:10:44 1.2
***************
*** 59,71 ****
! spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
!
! /*
! * If our port doesn't define this it has no Au1000 DMA
! */
!
! #ifdef MAX_AU1000_DMA_CHANNELS
! static struct dma_chan dma_table[MAX_AU1000_DMA_CHANNELS] = {
{dev_id: -1,},
{dev_id: -1,},
--- 59,65 ----
! spinlock_t au1000_dma_spin_lock = SPIN_LOCK_UNLOCKED;
! struct dma_chan au1000_dma_table[NUM_AU1000_DMA_CHANNELS] = {
{dev_id: -1,},
{dev_id: -1,},
***************
*** 100,140 ****
{ I2S_DATA, DMA_DR | DMA_DW32 | DMA_NC }
};
-
- struct dma_chan *
- get_dma_chan (unsigned int dmanr)
- {
- if (dmanr > MAX_AU1000_DMA_CHANNELS ||
- dma_table[dmanr].dev_id < 0)
- return NULL;
- return &dma_table[dmanr];
- }
! int get_dma_list(char *buf)
{
! int i, len;
struct dma_chan * chan;
! len = sprintf(buf, "Au1000 Allocated DMA Channels:\n");
! len += sprintf(buf+len, "------------------------------\n");
!
! for (i = 0 ; i < MAX_AU1000_DMA_CHANNELS ; i++) {
if ((chan = get_dma_chan(i)) != NULL) {
! len += sprintf(buf+len, "%2d: %s\n",
! i,
! chan->dev_str);
}
}
return len;
! } /* get_dma_list */
! void dump_dma_channel(unsigned int dmanr)
{
struct dma_chan * chan;
! if (dmanr > MAX_AU1000_DMA_CHANNELS)
return;
! chan = &dma_table[dmanr];
printk(KERN_INFO "Au1000 DMA%d Register Dump:\n", dmanr);
--- 94,131 ----
{ I2S_DATA, DMA_DR | DMA_DW32 | DMA_NC }
};
! int au1000_dma_read_proc (char *buf, char **start, off_t fpos,
! int length, int *eof, void *data)
{
! int i, len=0;
struct dma_chan * chan;
! for (i = 0 ; i < NUM_AU1000_DMA_CHANNELS ; i++) {
if ((chan = get_dma_chan(i)) != NULL) {
! len += sprintf(buf+len, "%2d: %s\n", i, chan->dev_str);
}
}
+
+ if (fpos >= len) {
+ *start = buf;
+ *eof = 1;
+ return 0;
+ }
+ *start = buf + fpos;
+ if ((len -= fpos) > length)
+ return length;
+ *eof = 1;
return len;
! }
! void dump_au1000_dma_channel(unsigned int dmanr)
{
struct dma_chan * chan;
! if (dmanr > NUM_AU1000_DMA_CHANNELS)
return;
! chan = &au1000_dma_table[dmanr];
printk(KERN_INFO "Au1000 DMA%d Register Dump:\n", dmanr);
***************
*** 152,156 ****
* Returns the allocated channel number, or negative on error.
*/
! int request_dma(int dev_id, const char * dev_str)
{
struct dma_chan * chan;
--- 143,147 ----
* Returns the allocated channel number, or negative on error.
*/
! int request_au1000_dma(int dev_id, const char * dev_str)
{
struct dma_chan * chan;
***************
*** 160,171 ****
return -EINVAL;
! for (i = 0 ; i < MAX_AU1000_DMA_CHANNELS ; i++) {
! if (dma_table[i].dev_id < 0)
break;
}
! if (i == MAX_AU1000_DMA_CHANNELS)
return -ENODEV;
! chan = &dma_table[i];
// fill it in
--- 151,162 ----
return -EINVAL;
! for (i = 0 ; i < NUM_AU1000_DMA_CHANNELS ; i++) {
! if (au1000_dma_table[i].dev_id < 0)
break;
}
! if (i == NUM_AU1000_DMA_CHANNELS)
return -ENODEV;
! chan = &au1000_dma_table[i];
// fill it in
***************
*** 181,185 ****
! void free_dma(unsigned int dmanr)
{
struct dma_chan * chan = get_dma_chan(dmanr);
--- 172,176 ----
! void free_au1000_dma(unsigned int dmanr)
{
struct dma_chan * chan = get_dma_chan(dmanr);
***************
*** 193,212 ****
chan->dev_id = -1;
} /* free_dma */
-
- #else
-
- int request_dma(unsigned int dmanr, const char *device_id)
- {
- return -EINVAL;
- }
-
- void free_dma(unsigned int dmanr)
- {
- }
-
- int get_dma_list(char *buf)
- {
- strcpy(buf, "No DMA\n");
- return 7;
- }
- #endif
--- 184,185 ----
Index: usbdev.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/common/usbdev.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** usbdev.c 2001/08/17 22:53:26 1.1
--- usbdev.c 2001/08/23 17:10:44 1.2
***************
*** 1077,1081 ****
// SETUP packet received ?
! if (cs & USBDEV_CS_SU) {
if (pkt->size == sizeof(devrequest)) {
devrequest setup;
--- 1077,1081 ----
// SETUP packet received ?
! //if (cs & USBDEV_CS_SU) { FIXME: uncomment!
if (pkt->size == sizeof(devrequest)) {
devrequest setup;
***************
*** 1086,1095 ****
memcpy(&setup, pkt->bufptr, sizeof(devrequest));
process_setup(serial, &setup);
! } else
! dbg(__FUNCTION__ ": wrong size SETUP received");
! } else {
! // DATAx packet received on endpoint 0
! // FIXME: will need a state machine for control OUT transactions
! dbg("got DATAx on EP0, size=%d, cs=%08x", pkt->size, cs);
}
--- 1086,1095 ----
memcpy(&setup, pkt->bufptr, sizeof(devrequest));
process_setup(serial, &setup);
! //} else FIXME: uncomment!
! //dbg(__FUNCTION__ ": wrong size SETUP received");
! } else {
! // DATAx packet received on endpoint 0
! // FIXME: will need a state machine for control OUT transactions
! dbg("got DATAx on EP0, size=%d, cs=%08x", pkt->size, cs);
}
***************
*** 1581,1586 ****
free_irq(ep->inirq, &usbserial);
//free_irq(ep->outirq, &usbserial);
! free_dma(ep->indma);
! free_dma(ep->outdma);
endpoint_flush(ep);
--- 1581,1586 ----
free_irq(ep->inirq, &usbserial);
//free_irq(ep->outirq, &usbserial);
! free_au1000_dma(ep->indma);
! free_au1000_dma(ep->outdma);
endpoint_flush(ep);
***************
*** 1590,1594 ****
ep = &usbserial.port[i].ep_bulkin;
free_irq(ep->inirq, &usbserial);
! free_dma(ep->indma);
endpoint_flush(ep);
--- 1590,1594 ----
ep = &usbserial.port[i].ep_bulkin;
free_irq(ep->inirq, &usbserial);
! free_au1000_dma(ep->indma);
endpoint_flush(ep);
***************
*** 1596,1600 ****
ep = &usbserial.port[i].ep_bulkout;
//free_irq(ep->outirq, &usbserial);
! free_dma(ep->outdma);
endpoint_flush(ep);
--- 1596,1600 ----
ep = &usbserial.port[i].ep_bulkout;
//free_irq(ep->outirq, &usbserial);
! free_au1000_dma(ep->outdma);
endpoint_flush(ep);
***************
*** 1689,1697 ****
ep->max_pkt_size = usbserial.dev_desc->bMaxPacketSize0;
ep->indma = ep->outdma = -1;
! if ((ep->indma = request_dma(ep_dma_id[0].id, ep_dma_id[0].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[0].str);
goto err_out;
}
! if ((ep->outdma = request_dma(ep_dma_id[1].id, ep_dma_id[1].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[1].str);
goto err_out;
--- 1689,1699 ----
ep->max_pkt_size = usbserial.dev_desc->bMaxPacketSize0;
ep->indma = ep->outdma = -1;
! if ((ep->indma = request_au1000_dma(ep_dma_id[0].id,
! ep_dma_id[0].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[0].str);
goto err_out;
}
! if ((ep->outdma = request_au1000_dma(ep_dma_id[1].id,
! ep_dma_id[1].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[1].str);
goto err_out;
***************
*** 1735,1740 ****
ep->max_pkt_size = ep->desc->wMaxPacketSize;
ep->indma = ep->outdma = -1;
! if ((ep->indma = request_dma(ep_dma_id[2+NUM_PORTS*i].id,
! ep_dma_id[2+NUM_PORTS*i].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[2+NUM_PORTS*i].str);
goto err_out;
--- 1737,1743 ----
ep->max_pkt_size = ep->desc->wMaxPacketSize;
ep->indma = ep->outdma = -1;
! if ((ep->indma =
! request_au1000_dma(ep_dma_id[2+NUM_PORTS*i].id,
! ep_dma_id[2+NUM_PORTS*i].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[2+NUM_PORTS*i].str);
goto err_out;
***************
*** 1754,1759 ****
ep->max_pkt_size = ep->desc->wMaxPacketSize;
ep->indma = ep->outdma = -1;
! if ((ep->outdma = request_dma(ep_dma_id[2+NUM_PORTS*i + 1].id,
! ep_dma_id[2+NUM_PORTS*i + 1].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[2+NUM_PORTS*i + 1].str);
goto err_out;
--- 1757,1763 ----
ep->max_pkt_size = ep->desc->wMaxPacketSize;
ep->indma = ep->outdma = -1;
! if ((ep->outdma =
! request_au1000_dma(ep_dma_id[2+NUM_PORTS*i + 1].id,
! ep_dma_id[2+NUM_PORTS*i + 1].str)) < 0) {
err("Can't get %s DMA\n", ep_dma_id[2+NUM_PORTS*i + 1].str);
goto err_out;
|