Changeset 39
- Timestamp:
- 03/15/03 19:31:46 (6 years ago)
- Files:
-
- cvs-import/trunk/driver/if_ath.c (modified) (10 diffs)
- cvs-import/trunk/driver/if_athvar.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cvs-import/trunk/driver/if_ath.c
r36 r39 82 82 static void ath_rate_ctl(struct ath_softc *, struct ieee80211_node *); 83 83 84 #ifdef CONFIG_PROC_FS 85 static void ath_proc_init(struct ath_softc *sc); 86 static void ath_proc_remove(struct ath_softc *sc); 87 #endif /* CONFIG_PROC_FS */ 88 84 89 #ifdef AR_DEBUG 85 int ath_debug = 2; /*XXX*/90 int ath_debug = 0; 86 91 #define IFF_DUMPPKTS(_ic) (ath_debug || netif_msg_dumppkts(_ic)) 87 92 static void ath_printrxbuf(struct ath_buf *bf); … … 229 234 dev->name, ether_sprintf(dev->dev_addr)); 230 235 236 ath_proc_init(sc); 237 231 238 sc->sc_attached = 1; 232 239 … … 250 257 ath_desc_free(sc); 251 258 ath_hal_detach(sc->sc_ah); 259 ath_proc_remove(sc); 252 260 ieee80211_ifdetach(dev); 253 261 } … … 296 304 HAL_INT status; 297 305 306 if (!sc->sc_attached) 307 return; 298 308 spin_lock_irq(&sc->sc_lock); 299 309 while (ath_hal_intrpend(ah)) { 300 310 ath_hal_getisr(ah, &status); 301 if (netif_msg_intr(&sc->sc_ic)) 302 printk(KERN_DEBUG "%s: interrupt, status 0x%x\n", 303 dev->name, status); 311 DPRINTF(("%s: interrupt, status 0x%x\n", 312 dev->name, status)); 304 313 if (status & HAL_INT_FATAL) { 305 printk("%s: hardware error (0x%x); resetting\n",314 printk("%s: hardware error 0x%x; resetting\n", 306 315 dev->name, status); 307 316 ath_hal_dumpstate(ah); /*XXX*/ … … 310 319 } 311 320 if (status & HAL_INT_RXORN) { 312 printk("%s: rx FIFO overrun (0x%x); resetting\n",321 printk("%s: rx FIFO overrun 0x%x; resetting\n", 313 322 dev->name, status); 314 323 ath_hal_dumpstate(ah); /*XXX*/ … … 318 327 if (status & HAL_INT_RXEOL) { 319 328 /* 320 * XXX The hardware should re-read the link when 321 * RXE bit is written, but it doesn't work at least 322 * on older revision of the hardware. 329 * XXX The hardware should re-read the link 330 * when the RXE bit is written, but it doesn't 331 * work at least on older revision of the 332 * hardware. 323 333 */ 324 334 sc->sc_rxlink = NULL; … … 412 422 else 413 423 val |= HAL_INT_SWBA; /* beacon prepare */ 424 val |= HAL_INT_TXDESC|HAL_INT_RXDESC; 414 425 ath_hal_intrset(ah, val | HAL_INT_GLOBAL); 415 426 … … 470 481 ath_draintxq(sc); /* clear pending tx frames */ 471 482 ath_stoprecv(sc); /* turn off frame recv */ 472 ath_hal_setpower(ah, PM_FULL_SLEEP, 0);483 ath_hal_setpower(ah, HAL_PM_FULL_SLEEP, 0); 473 484 } 474 485 ath_beacon_free(sc); … … 985 996 ds->ds_data = bf->bf_skbaddr; 986 997 ds->ds_ctl0 = 0; 987 ds->ds_ctl1 = skb ->len;998 ds->ds_ctl1 = skb_tailroom(skb); 988 999 ds->ds_status0 = ds->ds_status1 = 0; 989 1000 … … 1686 1697 } 1687 1698 #endif /* AR_DEBUG */ 1699 1700 #ifdef CONFIG_PROC_FS 1701 #include <linux/proc_fs.h> 1702 1703 static int 1704 ath_proc_debug_read(char *page, char **start, off_t off, 1705 int count, int *eof, void *data) 1706 { 1707 if (off != 0) { 1708 *eof = 1; 1709 return 0; 1710 } 1711 return sprintf(page, "%d\n", ath_debug); 1712 } 1713 1714 static int 1715 ath_proc_debug_write(struct file *file, const char *buf, 1716 unsigned long count, void *data) 1717 { 1718 int v; 1719 1720 if (sscanf(buf, "%d", &v) == 1) { 1721 ath_debug = v; 1722 return count; 1723 } else 1724 return -EINVAL; 1725 } 1726 1727 static int 1728 ath_proc_stats(char *page, char **start, off_t off, int count, int *eof, void *data) 1729 { 1730 struct ath_softc *sc = (struct ath_softc *) data; 1731 char *cp = page; 1732 1733 if (off != 0) { 1734 *eof = 1; 1735 return 0; 1736 } 1737 #define STAT(x) cp += sprintf(cp, #x "=%u\n", sc->sc_stats.ast_##x) 1738 STAT(watchdog); STAT(tx_encap); STAT(tx_nonode); 1739 STAT(tx_nombuf); STAT(tx_nomcl); STAT(tx_linear); 1740 STAT(tx_nodata); STAT(tx_busdma); STAT(tx_descerr); 1741 STAT(rx_crcerr); STAT(rx_fifoerr); STAT(rx_badcrypt); 1742 STAT(rx_phyerr); STAT(rx_phy_tim); STAT(rx_phy_par); 1743 STAT(rx_phy_rate); STAT(rx_phy_len); STAT(rx_phy_qam); 1744 STAT(rx_phy_srv); STAT(rx_phy_tor); 1745 return cp - page; 1746 #undef STAT 1747 } 1748 1749 static void 1750 ath_proc_init(struct ath_softc *sc) 1751 { 1752 struct proc_dir_entry *dp; 1753 1754 /* XXX this uses /proc/net, but we want /proc/net/drivers */ 1755 sc->sc_proc = proc_mkdir(sc->sc_ic.ic_dev.name, proc_net); 1756 if (sc->sc_proc == NULL) { 1757 printk(KERN_INFO "/proc/net/drivers/%s: failed to create\n", 1758 sc->sc_ic.ic_dev.name); 1759 return; 1760 } 1761 dp = create_proc_entry("debug", 0644, sc->sc_proc); 1762 if (dp) { 1763 dp->read_proc = ath_proc_debug_read; 1764 dp->write_proc = ath_proc_debug_write; 1765 dp->data = sc; 1766 } 1767 create_proc_read_entry("stats", 0644, sc->sc_proc, ath_proc_stats, sc); 1768 } 1769 1770 static void 1771 ath_proc_remove(struct ath_softc *sc) 1772 { 1773 if (sc->sc_proc != NULL) { 1774 remove_proc_entry("stats", sc->sc_proc); 1775 remove_proc_entry("debug", sc->sc_proc); 1776 remove_proc_entry(sc->sc_ic.ic_dev.name, proc_net); 1777 sc->sc_proc = NULL; 1778 } 1779 } 1780 #endif /* CONFIG_PROC_FS */ cvs-import/trunk/driver/if_athvar.h
r36 r39 85 85 struct ath_hal; 86 86 struct ath_desc; 87 struct proc_dir_entry; 87 88 88 89 struct ath_softc { … … 116 117 struct ath_nodestat sc_bss_stat; /* statistics for infra mode */ 117 118 struct ath_stats sc_stats; /* interface statistics */ 119 struct proc_dir_entry *sc_proc; /* /proc/net/drivers/ath%d */ 118 120 }; 119 121
