summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorxc151355 <none@none>2007-11-06 02:08:12 -0800
committerxc151355 <none@none>2007-11-06 02:08:12 -0800
commit1f156c6a7686102f9a1057cb9294c57041f3da68 (patch)
treefb6f52446ebae436848bcf0e418fa1350ecd0fc0 /usr/src
parente73dcbe0b61c8a05d9a4e8329d94277c8e63da2f (diff)
downloadillumos-joyent-1f156c6a7686102f9a1057cb9294c57041f3da68.tar.gz
6621738 ath driver crash for PCI ID 168c:0013
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/ath/ath_impl.h2
-rw-r--r--usr/src/uts/common/io/ath/ath_main.c24
2 files changed, 21 insertions, 5 deletions
diff --git a/usr/src/uts/common/io/ath/ath_impl.h b/usr/src/uts/common/io/ath/ath_impl.h
index f311d66493..a592522a7a 100644
--- a/usr/src/uts/common/io/ath/ath_impl.h
+++ b/usr/src/uts/common/io/ath/ath_impl.h
@@ -129,6 +129,8 @@ extern "C" {
#define ATH_TXDESC 1 /* number of descriptors per buffer */
#define ATH_TXMAXTRY 11 /* max number of transmit attempts */
+#define ATH_DEF_CACHE_BYTES 32 /* default cache line size */
+
/* driver-specific node state */
struct ath_node {
struct ieee80211_node an_node; /* base class */
diff --git a/usr/src/uts/common/io/ath/ath_main.c b/usr/src/uts/common/io/ath/ath_main.c
index 12a225cf83..9b50fcfc6c 100644
--- a/usr/src/uts/common/io/ath/ath_main.c
+++ b/usr/src/uts/common/io/ath/ath_main.c
@@ -307,7 +307,7 @@ ath_alloc_dma_mem(dev_info_t *devinfo, size_t memsize,
* Allocate handle
*/
err = ddi_dma_alloc_handle(devinfo, &dma_attr,
- DDI_DMA_SLEEP, NULL, &dma_p->dma_hdl);
+ DDI_DMA_SLEEP, NULL, &dma_p->dma_hdl);
if (err != DDI_SUCCESS)
return (DDI_FAILURE);
@@ -324,8 +324,8 @@ ath_alloc_dma_mem(dev_info_t *devinfo, size_t memsize,
* Bind the two together
*/
err = ddi_dma_addr_bind_handle(dma_p->dma_hdl, NULL,
- dma_p->mem_va, dma_p->alength, bind_flags,
- DDI_DMA_SLEEP, NULL, &dma_p->cookie, &dma_p->ncookies);
+ dma_p->mem_va, dma_p->alength, bind_flags,
+ DDI_DMA_SLEEP, NULL, &dma_p->cookie, &dma_p->ncookies);
if (err != DDI_DMA_MAPPED)
return (DDI_FAILURE);
@@ -1826,7 +1826,21 @@ ath_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
goto attach_fail0;
}
+ /*
+ * Cache line size is used to size and align various
+ * structures used to communicate with the hardware.
+ */
csz = pci_config_get8(asc->asc_cfg_handle, PCI_CONF_CACHE_LINESZ);
+ if (csz == 0) {
+ /*
+ * We must have this setup properly for rx buffer
+ * DMA to work so force a reasonable value here if it
+ * comes up zero.
+ */
+ csz = ATH_DEF_CACHE_BYTES / sizeof (uint32_t);
+ pci_config_put8(asc->asc_cfg_handle, PCI_CONF_CACHE_LINESZ,
+ csz);
+ }
asc->asc_cachelsz = csz << 2;
vendor_id = pci_config_get16(asc->asc_cfg_handle, PCI_CONF_VENID);
device_id = pci_config_get16(asc->asc_cfg_handle, PCI_CONF_DEVID);
@@ -2018,8 +2032,8 @@ ath_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
/* different instance has different WPA door */
(void) snprintf(ic->ic_wpadoor, MAX_IEEE80211STR, "%s_%s%d", WPA_DOOR,
- ddi_driver_name(devinfo),
- ddi_get_instance(devinfo));
+ ddi_driver_name(devinfo),
+ ddi_get_instance(devinfo));
/* Override 80211 default routines */
ic->ic_reset = ath_reset;