staging: brcm80211: delete unused/obsolete code
authorBrett Rudley <brudley@broadcom.com>
Wed, 29 Sep 2010 00:35:39 +0000 (17:35 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 30 Sep 2010 11:40:43 +0000 (04:40 -0700)
Delete unused attempt to debug through /proc.

Signed-off-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/sys/wl_mac80211.c
drivers/staging/brcm80211/sys/wl_mac80211.h

index 084e2f83d321a0897dfa24dd63665d17343f0525..9063677e8525d429d3a7f6ff1f81164c122c9eea 100644 (file)
@@ -92,12 +92,6 @@ void wlc_set_addrmatch(wlc_info_t *wlc, int match_reg_offset,
 static void wl_timer(ulong data);
 static void _wl_timer(wl_timer_t *t);
 
-/* proc fs */
-static int wl_proc_read(char *buffer, char **start, off_t offset, int length,
-                       int *eof, void *data);
-static int wl_proc_write(struct file *filp, const char __user *buff,
-                        unsigned long len, void *data);
-
 #ifdef WLC_HIGH_ONLY
 #define RPCQ_LOCK(_wl, _flags) spin_lock_irqsave(&(_wl)->rpcq_lock, (_flags))
 #define RPCQ_UNLOCK(_wl, _flags)  spin_unlock_irqrestore(&(_wl)->rpcq_lock, (_flags))
@@ -997,153 +991,15 @@ static wl_info_t *wl_attach(uint16 vendor, uint16 device, ulong regs,
 #endif                         /* BCMDBG */
        printf("\n");
 
-       wl->proc_entry = create_proc_entry(PROC_ENTRY_NAME, 0644, NULL);
-       if (wl->proc_entry == NULL) {
-               WL_ERROR(("create_proc_entry failed *******\n"));
-               ASSERT(0);
-       } else {
-               wl->proc_entry->read_proc = wl_proc_read;
-               wl->proc_entry->write_proc = wl_proc_write;
-               wl->proc_entry->data = wl;
-               /* wl->proc_entry->owner = THIS_MODULE; */
-
-               wl->ioctlbuf = (char *)vmalloc(PAGE_SIZE);
-               if (wl->ioctlbuf == NULL) {
-                       WL_ERROR(("%s: Vmalloc failed\n", __func__));
-               }
-               wl->ioctlbuf_sz = PAGE_SIZE;
-               memset(wl->ioctlbuf, 0, PAGE_SIZE);
-               wl->ioctlbuf[0] = '!';
-       }
-
        wl_found++;
        return wl;
 
  fail:
        wl_free(wl);
- fail1:
+fail1:
        return NULL;
 }
 
-#define PROC_MESSAGE  "Broadcom driver debugger access only.  Requires matching 'wl' app\n"
-
-/* OS Entry point when app attempts to read */
-static int
-wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof,
-            void *data)
-{
-       wl_info_t *wl = (wl_info_t *) data;
-
-       switch (wl->proc_state) {
-
-       case WL_PROC_IDLE:
-               return 0;
-
-       case WL_PROC_HAVE_IOC:
-               /* Give the processed buffer back to userland */
-               if (!wl->ioctl_in_progress) {
-                       WL_ERROR(("%s: No ioctl in progress nothing to read, 2\n", __func__));
-                       return 0;
-               }
-
-               if (wl->ioc.len > wl->ioctlbuf_sz) {
-               }
-               bcopy(wl->ioctlbuf, buffer + offset, wl->ioc.len);
-               wl->proc_state--;
-               wl->ioctl_in_progress = 0;
-               return wl->ioc.len + offset;
-
-       case WL_PROC_HAVE_BUF:
-               /* Give the processed IOC back to userland */
-               if (!wl->ioctl_in_progress) {
-                       WL_ERROR(("%s: No ioctl in progress nothing to read, 1\n", __func__));
-                       return 0;
-               }
-               if (length != sizeof(wl_ioctl_t)) {
-                       WL_ERROR(("%s: Reading ioc but len != sizeof(wl_ioctl_t)\n", __func__));
-                       return 0;
-               }
-               bcopy(&wl->ioc, buffer + offset, length);
-               wl->proc_state--;
-               return length + offset;
-
-       default:
-               WL_ERROR(("%s: Proc read out of sync. proc_state %d, ioctl_in_progress %d\n", __func__, wl->proc_state, wl->ioctl_in_progress));
-       }
-
-       WL_ERROR(("%s: Invalid ioctl!!!\n", __func__));
-       return 0;
-}
-
-/* OS Entry point when app attempts to write */
-static int
-wl_proc_write(struct file *filp, const char __user *buff, unsigned long length,
-             void *data)
-{
-       wl_info_t *wl = (wl_info_t *) data;
-       int bcmerror;
-
-       switch (wl->proc_state) {
-
-       case WL_PROC_IDLE:
-               if (wl->ioctl_in_progress) {
-                       WL_ERROR(("%s: ioctl still in progress\n", __func__));
-                       return -EIO;
-               }
-               if (length != sizeof(wl_ioctl_t)) {
-                       WL_ERROR(("%s: Expecting ioctl sized buf\n", __func__));
-                       return -EIO;
-               }
-               if (copy_from_user(&wl->ioc, buff, sizeof(wl_ioctl_t))) {
-                       WL_ERROR(("%s: copy from user failed\n", __func__));
-                       return -EIO;
-               }
-               wl->proc_state++;
-               wl->ioctl_in_progress++;
-               return sizeof(wl_ioctl_t);
-
-       case WL_PROC_HAVE_IOC:
-               if (!wl->ioctl_in_progress) {
-                       WL_ERROR(("%s: Ioctl not ready yet 1\n", __func__));
-                       return -EIO;
-               }
-               if (wl->ioctlbuf_sz < length) {
-                       WL_ERROR(("%s: Buf write, ioctl buf %d not big enough too hold buffer %d\n", __func__, (int)sizeof(wl->ioctlbuf), (int)length));
-                       WL_ERROR(("Shortening input\n"));
-                       length = wl->ioctlbuf_sz;
-               }
-               if (length != wl->ioc.len) {
-                       WL_ERROR(("%s: ioc.len %d != length param %d\n",
-                                 __func__, wl->ioc.len, (int)length));
-                       return -EIO;
-               }
-               if (copy_from_user(wl->ioctlbuf, buff, length)) {
-                       WL_ERROR(("%s: copy from user of %d bytes failed\n",
-                                 __func__, (int)length));
-                       return -EIO;
-               }
-               wl->proc_state++;
-
-               WL_LOCK(wl);
-               bcmerror =
-                   wlc_ioctl(wl->wlc, wl->ioc.cmd, wl->ioctlbuf, wl->ioc.len,
-                             NULL);
-               WL_UNLOCK(wl);
-
-               if (bcmerror < 0)
-                       return bcmerror;
-
-               return length;
-
-       case WL_PROC_HAVE_BUF:
-               WL_ERROR(("%s: Illegal write.  Rejecting.\n", __func__));
-               return 0;
-       default:
-               WL_ERROR(("%s: Proc write out of sync. proc_state %d, ioctl_in_progress %d\n", __func__, wl->proc_state, wl->ioctl_in_progress));
-       }
-       return 0;
-}
-
 #ifdef WLC_HIGH_ONLY
 static void *wl_dbus_probe_cb(void *arg, const char *desc, uint32 bustype,
                              uint32 hdrlen)
@@ -1753,12 +1609,6 @@ void wl_free(wl_info_t *wl)
                MFREE(wl->osh, t, sizeof(wl_timer_t));
        }
 
-       if (wl->ioctlbuf_sz) {
-               remove_proc_entry(PROC_ENTRY_NAME, NULL);
-               vfree(wl->ioctlbuf);
-               wl->ioctlbuf_sz = 0;
-       }
-
        osh = wl->osh;
 
        /*
index a6c13a354393530fa1d285a4357d900325791a93..0a1cf2685fad85590a3df95d63144cdd5da3a283 100644 (file)
@@ -108,18 +108,8 @@ struct wl_info {
        uint stats_id;          /* the current set of stats */
        /* ping-pong stats counters updated by Linux watchdog */
        struct net_device_stats stats_watchdog[2];
-
-       struct proc_dir_entry *proc_entry;
-       char *ioctlbuf;
-       unsigned int ioctlbuf_sz;
-       wl_ioctl_t ioc;
-       int proc_state;
-       bool ioctl_in_progress;
        struct wl_firmware fw;
 };
-#define WL_PROC_IDLE           (0)
-#define WL_PROC_HAVE_IOC       (1)
-#define WL_PROC_HAVE_BUF       (2)
 
 #ifndef WLC_HIGH_ONLY
 #define WL_LOCK(wl)    spin_lock_bh(&(wl)->lock)