summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack/usb_serial.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-04-18 16:42:50 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-04-18 16:42:50 +0000
commit94f7d0f29095e056de281b2159a85e0f4c73d61a (patch)
tree65c9b8476cee034848cab13e5f73561e6fc35254 /firmware/usbstack/usb_serial.c
parent689d207bfbfe0cbc3d9cc840748ab9f07cc6a721 (diff)
downloadrockbox-94f7d0f29095e056de281b2159a85e0f4c73d61a.tar.gz
rockbox-94f7d0f29095e056de281b2159a85e0f4c73d61a.tar.bz2
rockbox-94f7d0f29095e056de281b2159a85e0f4c73d61a.zip
UMS for the Gigabeat S. Bootloader USB mode. Has a couple quirks 1) First plug has problems if cold. Replug if it doesn't connect or not at high speed 2) Linux doesn't like the odd bootable flag value used in the partitions so it won't mount but Windows works. Fix minor OTG driver bugs and clean up device memory handling. Generic name for ARC controller driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17154 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/usb_serial.c')
-rw-r--r--firmware/usbstack/usb_serial.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c
index 55b76adc69..f39035462f 100644
--- a/firmware/usbstack/usb_serial.c
+++ b/firmware/usbstack/usb_serial.c
@@ -5,7 +5,7 @@
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
- * $Id: $
+ * $Id$
*
* Copyright (C) 2007 by Christian Gmeiner
*
@@ -53,11 +53,10 @@ struct usb_endpoint_descriptor __attribute__((aligned(2))) endpoint_descriptor =
};
#define BUFFER_SIZE 512 /* Max 16k because of controller limitations */
-static unsigned char _send_buffer[BUFFER_SIZE] __attribute__((aligned(32)));
-static unsigned char* send_buffer;
-
-static unsigned char _receive_buffer[512] __attribute__((aligned(32)));
-static unsigned char* receive_buffer;
+static unsigned char send_buffer[BUFFER_SIZE]
+ USBDEVBSS_ATTR __attribute__((aligned(32)));
+static unsigned char receive_buffer[512]
+ USBDEVBSS_ATTR __attribute__((aligned(32)));
static bool busy_sending = false;
static int buffer_start;
static int buffer_length;
@@ -66,7 +65,7 @@ static bool active = false;
static int usb_endpoint;
static int usb_interface;
-static struct mutex sendlock;
+static struct mutex sendlock SHAREDBSS_ATTR;
static void sendout(void)
{
@@ -111,7 +110,7 @@ void usb_serial_init_connection(int interface,int endpoint)
usb_endpoint = endpoint;
/* prime rx endpoint */
- usb_drv_recv(usb_endpoint, receive_buffer, sizeof _receive_buffer);
+ usb_drv_recv(usb_endpoint, receive_buffer, sizeof receive_buffer);
/* we come here too after a bus reset, so reset some data */
mutex_lock(&sendlock);
@@ -127,8 +126,6 @@ void usb_serial_init_connection(int interface,int endpoint)
void usb_serial_init(void)
{
logf("serial: init");
- send_buffer = (void*)UNCACHED_ADDR(&_send_buffer);
- receive_buffer = (void*)UNCACHED_ADDR(&_receive_buffer);
busy_sending = false;
buffer_start = 0;
buffer_length = 0;
@@ -190,7 +187,7 @@ void usb_serial_transfer_complete(bool in, int status, int length)
case false:
logf("serial: %s", receive_buffer);
/* Data received. TODO : Do something with it ? */
- usb_drv_recv(usb_endpoint, receive_buffer, sizeof _receive_buffer);
+ usb_drv_recv(usb_endpoint, receive_buffer, sizeof receive_buffer);
break;
case true: