LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Variables
usbserial.c File Reference
#include <stdio.h>
#include <time.h>
#include <memory.h>
#include <stdint.h>
#include "usbhack.h"
#include "lib_malloc.h"
#include "lib_queue.h"
#include "usbchap9.h"
#include "usbd.h"
Include dependency graph for usbserial.c:

Go to the source code of this file.

Data Structures

struct  usbser_linedata_s
 
struct  usbser_bauddata_s
 
struct  usbserial_softc_s
 

Macros

#define CACHE_ALIGN   32 /* XXX place holder, big enough to now. */
 
#define BUFF_ALIGN   16
 
#define ALIGN(n, align)   (((n)+((align)-1)) & ~((align)-1))
 
#define usb_dma_alloc(n)   (KMALLOC(ALIGN((n),CACHE_ALIGN),BUFF_ALIGN))
 
#define usb_dma_free(p)   (KFREE(p))
 
#define USER_FIFOSIZE   256
 
#define PL_SET_REQ   0x21
 
#define PL_GET_REQ   0xA1
 
#define PL_REQ_SET_LINE_CODING   0x20
 
#define PL_REQ_GET_LINE_CODING   0x21
 
#define MCT_SET_REQ   0x40
 
#define MCT_GET_REQ   0xC0
 
#define MCT_REQ_SET_BAUD   0x05
 
#define GETDWFIELD(s, f)
 
#define PUTDWFIELD(s, f, v)
 

Typedefs

typedef struct usbser_linedata_s usbser_linedata_t
 
typedef struct usbser_bauddata_s usbser_bauddata_t
 
typedef struct usbserial_softc_s usbserial_softc_t
 

Variables

usb_driver_t usbserial_driver
 

Macro Definition Documentation

◆ ALIGN

#define ALIGN (   n,
  align 
)    (((n)+((align)-1)) & ~((align)-1))

Definition at line 76 of file usbserial.c.

◆ BUFF_ALIGN

#define BUFF_ALIGN   16

Definition at line 75 of file usbserial.c.

◆ CACHE_ALIGN

#define CACHE_ALIGN   32 /* XXX place holder, big enough to now. */

Definition at line 74 of file usbserial.c.

◆ GETDWFIELD

#define GETDWFIELD (   s,
 
)
Value:
((uint32_t)((s)->f##0) | ((uint32_t)((s)->f##1) << 8) | \
((uint32_t)((s)->f##2) << 16) | ((uint32_t)((s)->f##3) << 24))
u32 uint32_t
Definition: libfdt_env.h:11

Definition at line 126 of file usbserial.c.

◆ MCT_GET_REQ

#define MCT_GET_REQ   0xC0

Definition at line 117 of file usbserial.c.

◆ MCT_REQ_SET_BAUD

#define MCT_REQ_SET_BAUD   0x05

Definition at line 119 of file usbserial.c.

◆ MCT_SET_REQ

#define MCT_SET_REQ   0x40

Definition at line 116 of file usbserial.c.

◆ PL_GET_REQ

#define PL_GET_REQ   0xA1

Definition at line 102 of file usbserial.c.

◆ PL_REQ_GET_LINE_CODING

#define PL_REQ_GET_LINE_CODING   0x21

Definition at line 105 of file usbserial.c.

◆ PL_REQ_SET_LINE_CODING

#define PL_REQ_SET_LINE_CODING   0x20

Definition at line 104 of file usbserial.c.

◆ PL_SET_REQ

#define PL_SET_REQ   0x21

Definition at line 101 of file usbserial.c.

◆ PUTDWFIELD

#define PUTDWFIELD (   s,
  f,
 
)
Value:
(s)->f##0 = (v & 0xFF); \
(s)->f##1 = ((v)>>8 & 0xFF); \
(s)->f##2 = ((v)>>16 & 0xFF); \
(s)->f##3 = ((v)>>24 & 0xFF);

Definition at line 128 of file usbserial.c.

◆ usb_dma_alloc

#define usb_dma_alloc (   n)    (KMALLOC(ALIGN((n),CACHE_ALIGN),BUFF_ALIGN))

Definition at line 78 of file usbserial.c.

◆ usb_dma_free

#define usb_dma_free (   p)    (KFREE(p))

Definition at line 79 of file usbserial.c.

◆ USER_FIFOSIZE

#define USER_FIFOSIZE   256

Definition at line 85 of file usbserial.c.

Typedef Documentation

◆ usbser_bauddata_t

◆ usbser_linedata_t

◆ usbserial_softc_t

Variable Documentation

◆ usbserial_driver

usb_driver_t usbserial_driver
Initial value:
= {
"USB Serial Port",
usbserial_attach,
usbserial_detach
}

Definition at line 207 of file usbserial.c.