RetroArch
Macros | Functions | Variables
usbgecko.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <gccore.h>
#include <machine/processor.h>
#include "usbgecko.h"
Include dependency graph for usbgecko.c:

Macros

#define _SHIFTL(v, s, w)   ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
 
#define _SHIFTR(v, s, w)   ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
 

Functions

static s32 __usbgecko_exi_unlock (s32 chan, s32 dev)
 
static void __usbgecko_init ()
 
static __inline__ void __usbgecko_exi_wait (s32 chn)
 
static __inline__ int __send_command (s32 chn, u16 *cmd)
 
static __inline__ int __flashwritecommand (s32 chn, u32 flashaddress, u8 flashdata)
 
static __inline__ int __flashreadcommand (s32 chn, u32 flashaddress, u8 *flashdata)
 
static int __usb_sendbyte (s32 chn, char ch)
 
static int __usb_recvbyte (s32 chn, char *ch)
 
int __usb_checksend (s32 chn)
 
int __usb_checkrecv (s32 chn)
 
void usb_flush (s32 chn)
 
int usb_isgeckoalive (s32 chn)
 
int usb_recvbuffer_ex (s32 chn, void *buffer, int size, int retries)
 
int usb_recvbuffer (s32 chn, void *buffer, int size)
 
int usb_sendbuffer_ex (s32 chn, const void *buffer, int size, int retries)
 
int usb_sendbuffer (s32 chn, const void *buffer, int size)
 
int usb_recvbuffer_safe_ex (s32 chn, void *buffer, int size, int retries)
 
int usb_recvbuffer_safe (s32 chn, void *buffer, int size)
 
int usb_sendbuffer_safe_ex (s32 chn, const void *buffer, int size, int retries)
 
int usb_sendbuffer_safe (s32 chn, const void *buffer, int size)
 
static int __flashsoftwareid_entry (s32 chn)
 
static int __flashsoftwareid_exit (s32 chn)
 
int usb_flashread (s32 chn, u32 offset, void *buffer, size_t length)
 
int usb_flashwrite (s32 chn, u32 offset, const void *buffer, size_t length)
 
int usb_flashverify (s32 chn)
 

Variables

static u32 usbgecko_inited = 0
 
static lwpq_t wait_exi_queue [2]
 

Macro Definition Documentation

◆ _SHIFTL

#define _SHIFTL (   v,
  s,
  w 
)    ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))

◆ _SHIFTR

#define _SHIFTR (   v,
  s,
  w 
)    ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))

Function Documentation

◆ __flashreadcommand()

static __inline__ int __flashreadcommand ( s32  chn,
u32  flashaddress,
u8 flashdata 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __flashsoftwareid_entry()

static int __flashsoftwareid_entry ( s32  chn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __flashsoftwareid_exit()

static int __flashsoftwareid_exit ( s32  chn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __flashwritecommand()

static __inline__ int __flashwritecommand ( s32  chn,
u32  flashaddress,
u8  flashdata 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __send_command()

static __inline__ int __send_command ( s32  chn,
u16 cmd 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __usb_checkrecv()

int __usb_checkrecv ( s32  chn)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __usb_checksend()

int __usb_checksend ( s32  chn)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __usb_recvbyte()

static int __usb_recvbyte ( s32  chn,
char *  ch 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __usb_sendbyte()

static int __usb_sendbyte ( s32  chn,
char  ch 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __usbgecko_exi_unlock()

static s32 __usbgecko_exi_unlock ( s32  chan,
s32  dev 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __usbgecko_exi_wait()

static __inline__ void __usbgecko_exi_wait ( s32  chn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __usbgecko_init()

static void __usbgecko_init ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_flashread()

int usb_flashread ( s32  chn,
u32  offset,
void buffer,
size_t  length 
)
Here is the call graph for this function:

◆ usb_flashverify()

int usb_flashverify ( s32  chn)
Here is the call graph for this function:

◆ usb_flashwrite()

int usb_flashwrite ( s32  chn,
u32  offset,
const void buffer,
size_t  length 
)
Here is the call graph for this function:

◆ usb_flush()

void usb_flush ( s32  chn)
Here is the call graph for this function:

◆ usb_isgeckoalive()

int usb_isgeckoalive ( s32  chn)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_recvbuffer()

int usb_recvbuffer ( s32  chn,
void buffer,
int  size 
)
Here is the call graph for this function:

◆ usb_recvbuffer_ex()

int usb_recvbuffer_ex ( s32  chn,
void buffer,
int  size,
int  retries 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_recvbuffer_safe()

int usb_recvbuffer_safe ( s32  chn,
void buffer,
int  size 
)
Here is the call graph for this function:

◆ usb_recvbuffer_safe_ex()

int usb_recvbuffer_safe_ex ( s32  chn,
void buffer,
int  size,
int  retries 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_sendbuffer()

int usb_sendbuffer ( s32  chn,
const void buffer,
int  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_sendbuffer_ex()

int usb_sendbuffer_ex ( s32  chn,
const void buffer,
int  size,
int  retries 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_sendbuffer_safe()

int usb_sendbuffer_safe ( s32  chn,
const void buffer,
int  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_sendbuffer_safe_ex()

int usb_sendbuffer_safe_ex ( s32  chn,
const void buffer,
int  size,
int  retries 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ usbgecko_inited

u32 usbgecko_inited = 0
static

◆ wait_exi_queue

lwpq_t wait_exi_queue[2]
static