if_an.c (199756) | if_an.c (199757) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33 * Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD. 34 * 35 * Written by Bill Paul <wpaul@ctr.columbia.edu> 36 * Electrical Engineering Department 37 * Columbia University, New York City 38 */ 39 40#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33 * Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD. 34 * 35 * Written by Bill Paul <wpaul@ctr.columbia.edu> 36 * Electrical Engineering Department 37 * Columbia University, New York City 38 */ 39 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/sys/dev/an/if_an.c 199756 2009-11-24 16:54:54Z jhb $"); | 41__FBSDID("$FreeBSD: head/sys/dev/an/if_an.c 199757 2009-11-24 16:57:35Z jhb $"); |
42 43/* 44 * The Aironet 4500/4800 series cards come in PCMCIA, ISA and PCI form. 45 * This driver supports all three device types (PCI devices are supported 46 * through an extra PCI shim: /sys/dev/an/if_an_pci.c). ISA devices can be 47 * supported either using hard-coded IO port/IRQ settings or via Plug 48 * and Play. The 4500 series devices support 1Mbps and 2Mbps data rates. 49 * The 4800 devices support 1, 2, 5.5 and 11Mbps rates. --- 2745 unchanged lines hidden (view full) --- 2795 /* minus src/dest mac & type */ 2796 tx_frame_802_3.an_tx_802_3_payload_len = 2797 m0->m_pkthdr.len - 12; 2798 2799 m_copydata(m0, sizeof(struct ether_header) - 2 , 2800 tx_frame_802_3.an_tx_802_3_payload_len, 2801 (caddr_t)&sc->an_txbuf); 2802 | 42 43/* 44 * The Aironet 4500/4800 series cards come in PCMCIA, ISA and PCI form. 45 * This driver supports all three device types (PCI devices are supported 46 * through an extra PCI shim: /sys/dev/an/if_an_pci.c). ISA devices can be 47 * supported either using hard-coded IO port/IRQ settings or via Plug 48 * and Play. The 4500 series devices support 1Mbps and 2Mbps data rates. 49 * The 4800 devices support 1, 2, 5.5 and 11Mbps rates. --- 2745 unchanged lines hidden (view full) --- 2795 /* minus src/dest mac & type */ 2796 tx_frame_802_3.an_tx_802_3_payload_len = 2797 m0->m_pkthdr.len - 12; 2798 2799 m_copydata(m0, sizeof(struct ether_header) - 2 , 2800 tx_frame_802_3.an_tx_802_3_payload_len, 2801 (caddr_t)&sc->an_txbuf); 2802 |
2803 txcontrol = AN_TXCTL_8023; | 2803 txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); |
2804 /* write the txcontrol only */ 2805 an_write_data(sc, id, 0x08, (caddr_t)&txcontrol, 2806 sizeof(txcontrol)); 2807 2808 /* 802_3 header */ 2809 an_write_data(sc, id, 0x34, (caddr_t)&tx_frame_802_3, 2810 sizeof(struct an_txframe_802_3)); 2811 --- 46 unchanged lines hidden (view full) --- 2858 /* minus src/dest mac & type */ 2859 tx_frame_802_3.an_tx_802_3_payload_len = 2860 m0->m_pkthdr.len - 12; 2861 2862 m_copydata(m0, sizeof(struct ether_header) - 2 , 2863 tx_frame_802_3.an_tx_802_3_payload_len, 2864 (caddr_t)&sc->an_txbuf); 2865 | 2804 /* write the txcontrol only */ 2805 an_write_data(sc, id, 0x08, (caddr_t)&txcontrol, 2806 sizeof(txcontrol)); 2807 2808 /* 802_3 header */ 2809 an_write_data(sc, id, 0x34, (caddr_t)&tx_frame_802_3, 2810 sizeof(struct an_txframe_802_3)); 2811 --- 46 unchanged lines hidden (view full) --- 2858 /* minus src/dest mac & type */ 2859 tx_frame_802_3.an_tx_802_3_payload_len = 2860 m0->m_pkthdr.len - 12; 2861 2862 m_copydata(m0, sizeof(struct ether_header) - 2 , 2863 tx_frame_802_3.an_tx_802_3_payload_len, 2864 (caddr_t)&sc->an_txbuf); 2865 |
2866 txcontrol = AN_TXCTL_8023; | 2866 txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); |
2867 /* write the txcontrol only */ 2868 bcopy((caddr_t)&txcontrol, &buf[0x08], 2869 sizeof(txcontrol)); 2870 2871 /* 802_3 header */ 2872 bcopy((caddr_t)&tx_frame_802_3, &buf[0x34], 2873 sizeof(struct an_txframe_802_3)); 2874 --- 5 unchanged lines hidden (view full) --- 2880 bzero(&an_tx_desc, sizeof(an_tx_desc)); 2881 an_tx_desc.an_offset = 0; 2882 an_tx_desc.an_eoc = 1; 2883 an_tx_desc.an_valid = 1; 2884 an_tx_desc.an_len = 0x44 + 2885 tx_frame_802_3.an_tx_802_3_payload_len; 2886 an_tx_desc.an_phys 2887 = sc->an_tx_buffer[idx].an_dma_paddr; | 2867 /* write the txcontrol only */ 2868 bcopy((caddr_t)&txcontrol, &buf[0x08], 2869 sizeof(txcontrol)); 2870 2871 /* 802_3 header */ 2872 bcopy((caddr_t)&tx_frame_802_3, &buf[0x34], 2873 sizeof(struct an_txframe_802_3)); 2874 --- 5 unchanged lines hidden (view full) --- 2880 bzero(&an_tx_desc, sizeof(an_tx_desc)); 2881 an_tx_desc.an_offset = 0; 2882 an_tx_desc.an_eoc = 1; 2883 an_tx_desc.an_valid = 1; 2884 an_tx_desc.an_len = 0x44 + 2885 tx_frame_802_3.an_tx_802_3_payload_len; 2886 an_tx_desc.an_phys 2887 = sc->an_tx_buffer[idx].an_dma_paddr; |
2888 for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) { | 2888 for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0; i--) { |
2889 CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET 2890 /* zero for now */ 2891 + (0 * sizeof(an_tx_desc)) 2892 + (i * 4), 2893 ((u_int32_t *)(void *)&an_tx_desc)[i]); 2894 } 2895 2896 /* --- 936 unchanged lines hidden --- | 2889 CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET 2890 /* zero for now */ 2891 + (0 * sizeof(an_tx_desc)) 2892 + (i * 4), 2893 ((u_int32_t *)(void *)&an_tx_desc)[i]); 2894 } 2895 2896 /* --- 936 unchanged lines hidden --- |