Commit 6764cbd7 authored by Vijay Kumar's avatar Vijay Kumar Committed by Greg Kroah-Hartman

Staging: Remove staging/poch

Remove staging/poch.

Reasons for removal are -- The driver has serious cache
issues, that I couldn't fix. The card vendor is working
on a better replacement for the driver. The driver has
been delayed a lot and development has come to a stand
still.
Signed-off-by: default avatarVijay Kumar B. <vijaykumar@bravegnu.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 24d2d8be
...@@ -57,8 +57,6 @@ source "drivers/staging/wlan-ng/Kconfig" ...@@ -57,8 +57,6 @@ source "drivers/staging/wlan-ng/Kconfig"
source "drivers/staging/echo/Kconfig" source "drivers/staging/echo/Kconfig"
source "drivers/staging/poch/Kconfig"
source "drivers/staging/otus/Kconfig" source "drivers/staging/otus/Kconfig"
source "drivers/staging/rt2860/Kconfig" source "drivers/staging/rt2860/Kconfig"
......
...@@ -11,7 +11,6 @@ obj-$(CONFIG_USB_IP_COMMON) += usbip/ ...@@ -11,7 +11,6 @@ obj-$(CONFIG_USB_IP_COMMON) += usbip/
obj-$(CONFIG_W35UND) += winbond/ obj-$(CONFIG_W35UND) += winbond/
obj-$(CONFIG_PRISM2_USB) += wlan-ng/ obj-$(CONFIG_PRISM2_USB) += wlan-ng/
obj-$(CONFIG_ECHO) += echo/ obj-$(CONFIG_ECHO) += echo/
obj-$(CONFIG_POCH) += poch/
obj-$(CONFIG_OTUS) += otus/ obj-$(CONFIG_OTUS) += otus/
obj-$(CONFIG_RT2860) += rt2860/ obj-$(CONFIG_RT2860) += rt2860/
obj-$(CONFIG_RT2870) += rt2870/ obj-$(CONFIG_RT2870) += rt2870/
......
config POCH
tristate "Redrapids Pocket Change CardBus support"
depends on PCI && UIO
default N
---help---
Enable support for Redrapids Pocket Change CardBus devices.
obj-$(CONFIG_POCH) += poch.o
TODO:
- Rx block size is limited to < 2048, hardware bug?
- Group size is limited to < page size, kernel alloc/mmap API issues
- test whether Tx is transmitting data from provided buffers
- handle device unplug case
- handle temperature above threshold
- use bus address instead of physical address for DMA
- support for snapshot mode
- audit userspace interfaces
- get reserved major/minor if needed
Sample Code:
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <poll.h>
#include <stdio.h>
#include <error.h>
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <sysfs/libsysfs.h>
#include <poch.h>
struct pconsume {
uint32_t * offsets;
uint32_t nfetch;
uint32_t nflush;
};
uint32_t offsets[10];
void process_group(unsigned char *buf, uint32_t size)
{
uint16_t *buf16 = (uint16_t *)buf;
printf("RX: %p %u %04x %04x %04x %04x %04x %04x\n", buf, size,
buf16[0], buf16[1], buf16[2], buf16[3], buf16[4], buf16[5]);
}
int main()
{
struct sysfs_attribute *attr;
char *path;
int ret;
unsigned long mmap_size;
int fd;
unsigned char *cbuf;
uint32_t nflush;
struct pollfd poll_fds;
int count = 0;
int i;
path = "/sys/class/pocketchange/poch0/ch0/block_size";
attr = sysfs_open_attribute(path);
ret = sysfs_write_attribute(attr, "256", strlen("256"));
if (ret == -1)
error(1, errno, "error writing attribute %s", path);
sysfs_close_attribute(attr);
path = "/sys/class/pocketchange/poch0/ch0/group_size";
attr = sysfs_open_attribute(path);
ret = sysfs_write_attribute(attr, "4096", strlen("4096"));
if (ret == -1)
error(1, errno, "error writing attribute %s", path);
sysfs_close_attribute(attr);
path = "/sys/class/pocketchange/poch0/ch0/group_count";
attr = sysfs_open_attribute(path);
ret = sysfs_write_attribute(attr, "64", strlen("64"));
if (ret == -1)
error(1, errno, "error writing attribute %s", path);
sysfs_close_attribute(attr);
fd = open("/dev/ch0", O_RDWR);
if (fd == -1)
error(1, errno, "error opening device node");
path = "/sys/class/pocketchange/poch0/ch0/mmap_size";
attr = sysfs_open_attribute(path);
ret = sysfs_read_attribute(attr);
if (ret == -1)
error(1, errno, "error reading attribute %s", path);
printf("%s", attr->value);
sscanf(attr->value, "%lu", &mmap_size);
sysfs_close_attribute(attr);
cbuf = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE, fd, 0);
if (cbuf == MAP_FAILED)
error(1, errno, "error mapping DMA buffers");
ret = ioctl(fd, POCH_IOC_TRANSFER_START, 0);
if (ret == -1)
error(1, errno, "error starting transfer");
nflush = 0;
while (1) {
struct pconsume consume;
consume.offsets = offsets;
consume.nfetch = 10;
consume.nflush = nflush;
ret = ioctl(fd, POCH_IOC_CONSUME, &consume);
if (ret == -1)
error(1, errno, "error consuming groups");
nflush = consume.nfetch;
for (i = 0; i < nflush; i++) {
process_group(cbuf + consume.offsets[i], 4096);
count++;
if (count == 1000)
break;
}
if (count == 1000)
break;
}
ret = ioctl(fd, POCH_IOC_TRANSFER_STOP, 0);
if (ret == -1)
error(1, errno, "error starting transfer");
return 0;
}
Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
Vijay Kumar <vijaykumar@bravegnu.org> and Jaya Kumar <jayakumar.lkml@gmail.com>
This diff is collapsed.
/*
* User-space DMA and UIO based Redrapids Pocket Change CardBus driver
*
* Copyright 2008 Vijay Kumar <vijaykumar@bravegnu.org>
*
* Part of userspace API. Should be moved to a header file in
* include/linux for final version.
*
*/
#include <linux/types.h>
struct poch_counters {
__u32 fifo_empty;
__u32 fifo_overflow;
__u32 pll_unlock;
};
struct poch_consume {
__u32 __user *offsets;
__u32 nfetch;
__u32 nflush;
};
#define POCH_IOC_NUM '9'
#define POCH_IOC_TRANSFER_START _IO(POCH_IOC_NUM, 0)
#define POCH_IOC_TRANSFER_STOP _IO(POCH_IOC_NUM, 1)
#define POCH_IOC_GET_COUNTERS _IOR(POCH_IOC_NUM, 2, \
struct poch_counters)
#define POCH_IOC_SYNC_GROUP_FOR_USER _IO(POCH_IOC_NUM, 3)
#define POCH_IOC_SYNC_GROUP_FOR_DEVICE _IO(POCH_IOC_NUM, 4)
#define POCH_IOC_CONSUME _IOWR(POCH_IOC_NUM, 5, \
struct poch_consume)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment