PERFORCE change 59502 for review
Robert Watson
rwatson at FreeBSD.org
Thu Aug 12 07:53:26 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=59502
Change 59502 by rwatson at rwatson_paprika on 2004/08/12 14:52:40
Integrate netperf_socket from CVS:
Newcard pccbb pci attachments broken out, isa attachments.
pf upgrade/fixes.
A number of sched_ule changes.
IP fragment fix.
Affected files ...
.. //depot/projects/netperf_socket/sys/conf/files#45 integrate
.. //depot/projects/netperf_socket/sys/contrib/pf/net/pf.c#13 integrate
.. //depot/projects/netperf_socket/sys/contrib/pf/net/pf_if.c#3 integrate
.. //depot/projects/netperf_socket/sys/contrib/pf/net/pf_ioctl.c#9 integrate
.. //depot/projects/netperf_socket/sys/contrib/pf/net/pf_norm.c#7 integrate
.. //depot/projects/netperf_socket/sys/contrib/pf/net/pfvar.h#6 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aac.c#9 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aac_cam.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aac_disk.c#6 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aacvar.h#6 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-all.c#14 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-chipset.c#14 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-dma.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-pci.c#10 integrate
.. //depot/projects/netperf_socket/sys/dev/pccbb/pccbb.c#13 integrate
.. //depot/projects/netperf_socket/sys/dev/pccbb/pccbb_isa.c#1 branch
.. //depot/projects/netperf_socket/sys/dev/pccbb/pccbb_pci.c#1 branch
.. //depot/projects/netperf_socket/sys/dev/pccbb/pccbbvar.h#3 integrate
.. //depot/projects/netperf_socket/sys/kern/sched_ule.c#18 integrate
.. //depot/projects/netperf_socket/sys/netgraph/atm/ccatm/ng_ccatm.c#1 branch
.. //depot/projects/netperf_socket/sys/netgraph/atm/ccatm/ng_ccatm_cust.h#1 branch
.. //depot/projects/netperf_socket/sys/netgraph/atm/ng_ccatm.h#1 branch
.. //depot/projects/netperf_socket/sys/netinet/ip_input.c#19 integrate
Differences ...
==== //depot/projects/netperf_socket/sys/conf/files#45 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.937 2004/08/11 17:23:32 imp Exp $
+# $FreeBSD: src/sys/conf/files,v 1.938 2004/08/12 06:50:28 imp Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -599,6 +599,8 @@
dev/pccard/pccard_cis_quirks.c optional pccard
dev/pccard/power_if.m standard
dev/pccbb/pccbb.c optional cbb
+dev/pccbb/pccbb_isa.c optional cbb isa
+dev/pccbb/pccbb_pci.c optional cbb pci
dev/pci/eisa_pci.c optional pci eisa
dev/pci/fixup_pci.c optional pci
dev/pci/ignore_pci.c optional pci
==== //depot/projects/netperf_socket/sys/contrib/pf/net/pf.c#13 (text+ko) ====
@@ -1,5 +1,6 @@
-/* $FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.17 2004/07/28 06:14:44 kan Exp $ */
+/* $FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.18 2004/08/12 13:59:44 mlaier Exp $ */
/* $OpenBSD: pf.c,v 1.433.2.2 2004/07/17 03:22:34 brad Exp $ */
+/* add $OpenBSD: pf.c,v 1.448 2004/05/11 07:34:11 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -155,8 +156,6 @@
void pf_print_state(struct pf_state *);
void pf_print_flags(u_int8_t);
-u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t,
- u_int8_t);
void pf_change_ap(struct pf_addr *, u_int16_t *,
u_int16_t *, u_int16_t *, struct pf_addr *,
u_int16_t, u_int8_t, sa_family_t);
==== //depot/projects/netperf_socket/sys/contrib/pf/net/pf_if.c#3 (text+ko) ====
@@ -1,5 +1,6 @@
-/* $FreeBSD: src/sys/contrib/pf/net/pf_if.c,v 1.3 2004/07/23 03:37:05 mlaier Exp $ */
+/* $FreeBSD: src/sys/contrib/pf/net/pf_if.c,v 1.4 2004/08/12 13:54:50 mlaier Exp $ */
/* $OpenBSD: pf_if.c,v 1.11 2004/03/15 11:38:23 cedric Exp $ */
+/* add $OpenBSD: pf_if.c,v 1.19 2004/08/11 12:06:44 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -53,6 +54,7 @@
#include <net/if.h>
#include <net/if_types.h>
+#include <net/route.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
@@ -636,6 +638,8 @@
af = ia->ifa_addr->sa_family;
if (af != AF_INET && af != AF_INET6)
continue;
+ if (!(ia->ifa_flags & IFA_ROUTE))
+ continue;
if ((flags & PFI_AFLAG_BROADCAST) && af == AF_INET6)
continue;
if ((flags & PFI_AFLAG_BROADCAST) &&
==== //depot/projects/netperf_socket/sys/contrib/pf/net/pf_ioctl.c#9 (text+ko) ====
@@ -1,5 +1,5 @@
-/* $FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.11 2004/06/17 16:59:47 mlaier Exp $ */
-/* $OpenBSD: pf_ioctl.c,v 1.112.2.1 2004/04/30 21:43:30 brad Exp $ */
+/* $FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.12 2004/08/12 14:15:42 mlaier Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.112.2.2 2004/07/24 18:28:12 brad Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1503,7 +1503,8 @@
while ((oldrule != NULL) && (oldrule->nr != pcr->nr))
oldrule = TAILQ_NEXT(oldrule, entries);
if (oldrule == NULL) {
- pf_rm_rule(NULL, newrule);
+ if (newrule != NULL)
+ pf_rm_rule(NULL, newrule);
error = EINVAL;
splx(s);
break;
==== //depot/projects/netperf_socket/sys/contrib/pf/net/pf_norm.c#7 (text+ko) ====
@@ -1,5 +1,6 @@
-/* $FreeBSD: src/sys/contrib/pf/net/pf_norm.c,v 1.8 2004/07/28 06:14:44 kan Exp $ */
+/* $FreeBSD: src/sys/contrib/pf/net/pf_norm.c,v 1.9 2004/08/12 13:59:44 mlaier Exp $ */
/* $OpenBSD: pf_norm.c,v 1.80.2.1 2004/04/30 21:46:33 brad Exp $ */
+/* add $OpenBSD: pf_norm.c,v 1.87 2004/05/11 07:34:11 dhartmei Exp $ */
/*
* Copyright 2001 Niels Provos <provos at citi.umich.edu>
@@ -179,7 +180,6 @@
struct pf_frent *, int);
struct mbuf *pf_fragcache(struct mbuf **, struct ip*,
struct pf_fragment **, int, int, int *);
-u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t);
int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *,
struct tcphdr *, int);
@@ -1157,8 +1157,12 @@
if (r->min_ttl && h->ip_ttl < r->min_ttl)
h->ip_ttl = r->min_ttl;
- if (r->rule_flag & PFRULE_RANDOMID)
+ if (r->rule_flag & PFRULE_RANDOMID) {
+ u_int16_t ip_id = h->ip_id;
+
h->ip_id = ip_randomid();
+ h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0);
+ }
return (PF_PASS);
@@ -1454,13 +1458,13 @@
th->th_x2 = 0;
nv = *(u_int16_t *)(&th->th_ack + 1);
- th->th_sum = pf_cksum_fixup(th->th_sum, ov, nv);
+ th->th_sum = pf_cksum_fixup(th->th_sum, ov, nv, 0);
rewrite = 1;
}
/* Remove urgent pointer, if TH_URG is not set */
if (!(flags & TH_URG) && th->th_urp) {
- th->th_sum = pf_cksum_fixup(th->th_sum, th->th_urp, 0);
+ th->th_sum = pf_cksum_fixup(th->th_sum, th->th_urp, 0, 0);
th->th_urp = 0;
rewrite = 1;
}
@@ -1714,7 +1718,7 @@
mss = (u_int16_t *)(optp + 2);
if ((ntohs(*mss)) > r->max_mss) {
th->th_sum = pf_cksum_fixup(th->th_sum,
- *mss, htons(r->max_mss));
+ *mss, htons(r->max_mss), 0);
*mss = htons(r->max_mss);
rewrite = 1;
}
==== //depot/projects/netperf_socket/sys/contrib/pf/net/pfvar.h#6 (text+ko) ====
@@ -1,5 +1,6 @@
-/* $FreeBSD: src/sys/contrib/pf/net/pfvar.h,v 1.7 2004/06/22 20:13:25 brooks Exp $ */
+/* $FreeBSD: src/sys/contrib/pf/net/pfvar.h,v 1.8 2004/08/12 13:59:44 mlaier Exp $ */
/* $OpenBSD: pfvar.h,v 1.187 2004/03/22 04:54:18 mcbride Exp $ */
+/* add $OpenBSD: pfvar.h,v 1.194 2004/05/11 07:34:11 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1442,6 +1443,8 @@
char[PF_RULESET_NAME_SIZE]);
extern void pf_remove_if_empty_ruleset(
struct pf_ruleset *);
+extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t,
+ u_int8_t);
extern struct ifnet *sync_ifp;
extern struct pf_rule pf_default_rule;
==== //depot/projects/netperf_socket/sys/dev/aac/aac.c#9 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.96 2004/07/28 06:17:49 kan Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.100 2004/08/12 05:31:17 scottl Exp $");
/*
* Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
@@ -236,9 +236,9 @@
/*
* Initialize locks
*/
- AAC_LOCK_INIT(&sc->aac_aifq_lock, "AAC AIF lock");
- AAC_LOCK_INIT(&sc->aac_io_lock, "AAC I/O lock");
- AAC_LOCK_INIT(&sc->aac_container_lock, "AAC container lock");
+ mtx_init(&sc->aac_aifq_lock, "AAC AIF lock", NULL, MTX_DEF);
+ mtx_init(&sc->aac_io_lock, "AAC I/O lock", NULL, MTX_DEF);
+ mtx_init(&sc->aac_container_lock, "AAC container lock", NULL, MTX_DEF);
TAILQ_INIT(&sc->aac_container_tqh);
/* Initialize the local AIF queue pointers */
@@ -384,9 +384,9 @@
co->co_found = f;
bcopy(&mir->MntTable[0], &co->co_mntobj,
sizeof(struct aac_mntobj));
- AAC_LOCK_ACQUIRE(&sc->aac_container_lock);
+ mtx_lock(&sc->aac_container_lock);
TAILQ_INSERT_TAIL(&sc->aac_container_tqh, co, co_link);
- AAC_LOCK_RELEASE(&sc->aac_container_lock);
+ mtx_unlock(&sc->aac_container_lock);
}
}
@@ -494,6 +494,10 @@
aac_free(sc);
+ mtx_destroy(&sc->aac_aifq_lock);
+ mtx_destroy(&sc->aac_io_lock);
+ mtx_destroy(&sc->aac_container_lock);
+
return(0);
}
@@ -555,6 +559,7 @@
#endif
AAC_MASK_INTERRUPTS(sc);
+ aac_release_sync_fib(sc);
return(0);
}
@@ -719,7 +724,7 @@
debug_called(2);
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
sc->aifflags = AAC_AIFFLAGS_RUNNING;
while ((sc->aifflags & AAC_AIFFLAGS_EXIT) == 0) {
@@ -735,9 +740,9 @@
* will grab Giant, and would result in an LOR.
*/
if ((sc->aifflags & AAC_AIFFLAGS_ALLOCFIBS) != 0) {
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
aac_alloc_commands(sc);
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
sc->aifflags &= ~AAC_AIFFLAGS_ALLOCFIBS;
aac_startio(sc);
}
@@ -797,7 +802,7 @@
}
}
sc->aifflags &= ~AAC_AIFFLAGS_RUNNING;
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
wakeup(sc->aac_dev);
kthread_exit(0);
@@ -818,7 +823,7 @@
sc = (struct aac_softc *)context;
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
/* pull completed commands off the queue */
for (;;) {
@@ -851,7 +856,7 @@
sc->flags &= ~AAC_QUEUE_FRZN;
aac_startio(sc);
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
}
/*
@@ -1150,7 +1155,7 @@
aac_map_command_helper, &fibphys, 0);
/* initialise constant fields in the command structure */
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
bzero(fm->aac_fibs, AAC_FIB_COUNT * sizeof(struct aac_fib));
for (i = 0; i < AAC_FIB_COUNT; i++) {
cm = sc->aac_commands + sc->total_fibs;
@@ -1171,11 +1176,11 @@
if (i > 0) {
TAILQ_INSERT_TAIL(&sc->aac_fibmap_tqh, fm, fm_link);
debug(1, "total_fibs= %d\n", sc->total_fibs);
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
return (0);
}
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
bus_dmamap_unload(sc->aac_fib_dmat, fm->aac_fibmap);
bus_dmamem_free(sc->aac_fib_dmat, fm->aac_fibs, fm->aac_fibmap);
free(fm, M_AACBUF);
@@ -2442,12 +2447,12 @@
sc = dev->si_drv1;
revents = 0;
- AAC_LOCK_ACQUIRE(&sc->aac_aifq_lock);
+ mtx_lock(&sc->aac_aifq_lock);
if ((poll_events & (POLLRDNORM | POLLIN)) != 0) {
if (sc->aac_aifq_tail != sc->aac_aifq_head)
revents |= poll_events & (POLLIN | POLLRDNORM);
}
- AAC_LOCK_RELEASE(&sc->aac_aifq_lock);
+ mtx_unlock(&sc->aac_aifq_lock);
if (revents == 0) {
if (poll_events & (POLLIN | POLLRDNORM))
@@ -2473,7 +2478,7 @@
/*
* Get a command
*/
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
if (aac_alloc_command(sc, &cm)) {
error = EBUSY;
goto out;
@@ -2521,7 +2526,7 @@
aac_release_command(cm);
}
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
return(error);
}
@@ -2631,13 +2636,11 @@
device_delete_child(sc->aac_dev,
co->co_disk);
co_next = TAILQ_NEXT(co, co_link);
- AAC_LOCK_ACQUIRE(&sc->
- aac_container_lock);
+ mtx_lock(&sc->aac_container_lock);
TAILQ_REMOVE(&sc->aac_container_tqh, co,
co_link);
- AAC_LOCK_RELEASE(&sc->
- aac_container_lock);
- FREE(co, M_AACBUF);
+ mtx_unlock(&sc->aac_container_lock);
+ free(co, M_AACBUF);
co = co_next;
} else {
co->co_found = 0;
@@ -2660,7 +2663,7 @@
}
/* Copy the AIF data to the AIF queue for ioctl retrieval */
- AAC_LOCK_ACQUIRE(&sc->aac_aifq_lock);
+ mtx_lock(&sc->aac_aifq_lock);
next = (sc->aac_aifq_head + 1) % AAC_AIFQ_LENGTH;
if (next != sc->aac_aifq_tail) {
bcopy(aif, &sc->aac_aifq[next], sizeof(struct aac_aif_command));
@@ -2672,7 +2675,7 @@
/* Wakeup any poll()ers */
selwakeuppri(&sc->rcv_select, PRIBIO);
}
- AAC_LOCK_RELEASE(&sc->aac_aifq_lock);
+ mtx_unlock(&sc->aac_aifq_lock);
return;
}
@@ -2762,9 +2765,9 @@
debug_called(2);
- AAC_LOCK_ACQUIRE(&sc->aac_aifq_lock);
+ mtx_lock(&sc->aac_aifq_lock);
if (sc->aac_aifq_tail == sc->aac_aifq_head) {
- AAC_LOCK_RELEASE(&sc->aac_aifq_lock);
+ mtx_unlock(&sc->aac_aifq_lock);
return (EAGAIN);
}
@@ -2777,7 +2780,7 @@
else
sc->aac_aifq_tail = next;
- AAC_LOCK_RELEASE(&sc->aac_aifq_lock);
+ mtx_unlock(&sc->aac_aifq_lock);
return(error);
}
@@ -2807,7 +2810,7 @@
if (id == -1)
return (EINVAL);
- AAC_LOCK_ACQUIRE(&sc->aac_container_lock);
+ mtx_lock(&sc->aac_container_lock);
TAILQ_FOREACH(co, &sc->aac_container_tqh, co_link) {
if (co->co_mntobj.ObjectId == id)
break;
@@ -2830,7 +2833,7 @@
sprintf(&query_disk.diskDeviceName[0], "%s%d",
disk->ad_disk->d_name, disk->ad_disk->d_unit);
}
- AAC_LOCK_RELEASE(&sc->aac_container_lock);
+ mtx_unlock(&sc->aac_container_lock);
error = copyout((caddr_t)&query_disk, uptr,
sizeof(struct aac_query_disk));
==== //depot/projects/netperf_socket/sys/dev/aac/aac_cam.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.16 2004/06/02 18:15:48 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.17 2004/08/12 05:05:06 scottl Exp $");
/*
* CAM front-end for communicating with non-DASD devices
@@ -290,9 +290,9 @@
/* Async ops that require communcation with the controller */
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
if (aac_alloc_command(sc, &cm)) {
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
xpt_freeze_simq(sim, 1);
ccb->ccb_h.status = CAM_REQUEUE_REQ;
xpt_done(ccb);
@@ -413,7 +413,7 @@
aac_enqueue_ready(cm);
aac_startio(cm->cm_sc);
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
return;
}
@@ -496,11 +496,11 @@
aac_release_command(cm);
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
mtx_lock(&Giant);
xpt_done(ccb);
mtx_unlock(&Giant);
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
return;
}
==== //depot/projects/netperf_socket/sys/dev/aac/aac_disk.c#6 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac_disk.c,v 1.40 2004/07/28 06:17:49 kan Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac_disk.c,v 1.41 2004/08/12 05:05:06 scottl Exp $");
#include "opt_aac.h"
@@ -175,9 +175,9 @@
/* perform accounting */
/* pass the bio to the controller - it can work out who we are */
- AAC_LOCK_ACQUIRE(&sc->ad_controller->aac_io_lock);
+ mtx_lock(&sc->ad_controller->aac_io_lock);
aac_submit_bio(bp);
- AAC_LOCK_RELEASE(&sc->ad_controller->aac_io_lock);
+ mtx_unlock(&sc->ad_controller->aac_io_lock);
return;
}
==== //depot/projects/netperf_socket/sys/dev/aac/aacvar.h#6 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.44 2004/06/16 09:46:35 phk Exp $
+ * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.45 2004/08/12 05:05:06 scottl Exp $
*/
#include <sys/bio.h>
@@ -261,13 +261,6 @@
#define AAC_GETREG1(sc, reg) bus_space_read_1 (sc->aac_btag, \
sc->aac_bhandle, reg)
-/* Define the OS version specific locks */
-typedef struct mtx aac_lock_t;
-#define AAC_LOCK_INIT(l, s) mtx_init(l, s, NULL, MTX_DEF)
-#define AAC_LOCK_ACQUIRE(l) mtx_lock(l)
-#define AAC_LOCK_RELEASE(l) mtx_unlock(l)
-
-
/*
* Per-controller structure.
*/
@@ -330,13 +323,13 @@
/* connected containters */
TAILQ_HEAD(,aac_container) aac_container_tqh;
- aac_lock_t aac_container_lock;
+ struct mtx aac_container_lock;
/*
* The general I/O lock. This protects the sync fib, the lists, the
* queues, and the registers.
*/
- aac_lock_t aac_io_lock;
+ struct mtx aac_io_lock;
/* delayed activity infrastructure */
struct task aac_task_complete; /* deferred-completion
@@ -345,7 +338,7 @@
/* management interface */
struct cdev *aac_dev_t;
- aac_lock_t aac_aifq_lock;
+ struct mtx aac_aifq_lock;
struct aac_aif_command aac_aifq[AAC_AIFQ_LENGTH];
int aac_aifq_head;
int aac_aifq_tail;
@@ -576,7 +569,7 @@
aac_alloc_sync_fib(struct aac_softc *sc, struct aac_fib **fib)
{
- AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ mtx_lock(&sc->aac_io_lock);
*fib = &sc->aac_common->ac_sync_fib;
return (0);
}
@@ -585,6 +578,6 @@
aac_release_sync_fib(struct aac_softc *sc)
{
- AAC_LOCK_RELEASE(&sc->aac_io_lock);
+ mtx_unlock(&sc->aac_io_lock);
}
==== //depot/projects/netperf_socket/sys/dev/ata/ata-all.c#14 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.220 2004/08/09 12:02:32 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.221 2004/08/12 08:20:36 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -112,6 +112,19 @@
if (ch->r_irq)
return EEXIST;
+ return 0;
+}
+
+
+int
+ata_attach(device_t dev)
+{
+ struct ata_channel *ch;
+ int error, rid;
+
+ if (!dev || !(ch = device_get_softc(dev)))
+ return ENXIO;
+
/* initialize the softc basics */
ch->device[MASTER].channel = ch;
ch->device[MASTER].unit = ATA_MASTER;
@@ -126,18 +139,7 @@
ch->locking(ch, ATA_LF_LOCK);
ch->hw.reset(ch);
ch->locking(ch, ATA_LF_UNLOCK);
- return 0;
-}
-int
-ata_attach(device_t dev)
-{
- struct ata_channel *ch;
- int error, rid;
-
- if (!dev || !(ch = device_get_softc(dev)))
- return ENXIO;
-
rid = ATA_IRQ_RID;
ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_SHAREABLE | RF_ACTIVE);
@@ -151,9 +153,6 @@
return error;
}
- if (ch->dma)
- ch->dma->alloc(ch);
-
/* initialize queue and associated lock */
bzero(&ch->queue_mtx, sizeof(struct mtx));
mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF);
@@ -223,9 +222,6 @@
ch->device[SLAVE].mode = ATA_PIO;
ch->devices = 0;
- if (ch->dma)
- ch->dma->free(ch);
-
bus_teardown_intr(dev, ch->r_irq, ch->ih);
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
ch->r_irq = NULL;
@@ -306,6 +302,7 @@
if (!dev || !(ch = device_get_softc(dev)))
return ENXIO;
+
ch->locking(ch, ATA_LF_LOCK);
ATA_SLEEPLOCK_CH(ch);
return 0;
==== //depot/projects/netperf_socket/sys/dev/ata/ata-chipset.c#14 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.78 2004/08/05 21:13:41 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.79 2004/08/12 08:20:36 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -185,7 +185,7 @@
* if we detect that the device isn't a real SATA device we limit
* the transfer mode to UDMA5/ATA100.
* this works around the problems some devices has with the
- * Marvell SATA->PATA converters and UDMA6/ATA133.
+ * Marvell 88SX8030 SATA->PATA converters and UDMA6/ATA133.
*/
if (atadev->param->satacapabilities != 0x0000 &&
atadev->param->satacapabilities != 0xffff)
@@ -1365,7 +1365,6 @@
ch->r_io[ATA_IDX_ADDR].res = ctlr->r_res2;
ch->flags |= ATA_USE_16BIT;
- ctlr->dmainit(ch);
ata_generic_hw(ch);
if (ctlr->chip->cfg2 & PRSX4X)
ch->hw.command = ata_promise_sx4_command;
@@ -2141,8 +2140,7 @@
if (ctlr->chip->max_dma >= ATA_SA150)
ch->flags |= ATA_NO_SLAVE;
- ctlr->dmainit(ch);
- if (ctlr->chip->cfg2 & SIIBUG)
+ if ((ctlr->chip->cfg2 & SIIBUG) && ch->dma)
ch->dma->boundary = 8 * 1024;
ata_generic_hw(ch);
==== //depot/projects/netperf_socket/sys/dev/ata/ata-dma.c#4 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.127 2004/08/05 21:13:41 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.128 2004/08/12 08:20:36 sos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -59,7 +59,7 @@
/* misc defines */
#define MAXSEGSZ PAGE_SIZE
#define MAXTABSZ PAGE_SIZE
-#define MAXWSPCSZ 256
+#define MAXWSPCSZ PAGE_SIZE
#define MAXCTLDMASZ (2 * (MAXTABSZ + MAXPHYS))
struct ata_dc_cb_args {
==== //depot/projects/netperf_socket/sys/dev/ata/ata-pci.c#10 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.86 2004/08/05 21:13:41 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.87 2004/08/12 08:20:36 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -241,13 +241,8 @@
int retval = 0;
retval += bus_print_child_header(dev, child);
- retval += printf(": at 0x%lx", rman_get_start(ch->r_io[ATA_IDX_ADDR].res));
-
- if (ata_legacy(dev))
- retval += printf(" irq %d", 14 + ch->unit);
-
+ retval += printf(": channel #%d", ch->unit);
retval += bus_print_child_footer(dev, child);
-
return retval;
}
@@ -428,15 +423,6 @@
ch->r_io[i].res = ctlr->r_res1;
ch->r_io[i].offset = (i - ATA_BMCMD_PORT)+(ch->unit * ATA_BMIOSIZE);
}
-
- /* if simplex controller, only allow DMA on primary channel */
- ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_IDX_INB(ch, ATA_BMSTAT_PORT) &
- (ATA_BMSTAT_DMA_MASTER | ATA_BMSTAT_DMA_SLAVE));
- if (ch->unit > 0 &&
- (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_DMA_SIMPLEX))
- device_printf(dev, "simplex device, DMA on primary only\n");
- else
- ctlr->dmainit(ch);
}
ata_generic_hw(ch);
@@ -517,12 +503,11 @@
DRIVER_MODULE(atapci, pci, ata_pci_driver, ata_pci_devclass, 0, 0);
static int
-ata_pcisub_probe(device_t dev)
+ata_channel_probe(device_t dev)
{
- struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
device_t *children;
- int count, error, i;
+ int count, i;
/* take care of green memory */
bzero(ch, sizeof(struct ata_channel));
@@ -535,31 +520,60 @@
}
free(children, M_TEMP);
+ return ata_probe(dev);
+}
+
+static int
+ata_channel_attach(device_t dev)
+{
+ struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
+ struct ata_channel *ch = device_get_softc(dev);
+ int error;
+
ch->device[MASTER].setmode = ctlr->setmode;
ch->device[SLAVE].setmode = ctlr->setmode;
ch->locking = ctlr->locking;
ch->reset = ctlr->reset;
+ ctlr->dmainit(ch);
+ if (ch->dma)
+ ch->dma->alloc(ch);
+
if ((error = ctlr->allocate(dev, ch)))
return error;
- return ata_probe(dev);
+ return ata_attach(dev);
+}
+
+static int
+ata_channel_detach(device_t dev)
+{
+ struct ata_channel *ch = device_get_softc(dev);
+ int error;
+
+ if ((error = ata_detach(dev)))
+ return error;
+
+ if (ch->dma)
+ ch->dma->free(ch);
+
+ return 0;
}
-static device_method_t ata_pcisub_methods[] = {
+static device_method_t ata_channel_methods[] = {
/* device interface */
- DEVMETHOD(device_probe, ata_pcisub_probe),
- DEVMETHOD(device_attach, ata_attach),
- DEVMETHOD(device_detach, ata_detach),
+ DEVMETHOD(device_probe, ata_channel_probe),
+ DEVMETHOD(device_attach, ata_channel_attach),
+ DEVMETHOD(device_detach, ata_channel_detach),
DEVMETHOD(device_suspend, ata_suspend),
DEVMETHOD(device_resume, ata_resume),
{ 0, 0 }
};
-static driver_t ata_pcisub_driver = {
+static driver_t ata_channel_driver = {
"ata",
- ata_pcisub_methods,
+ ata_channel_methods,
sizeof(struct ata_channel),
};
-DRIVER_MODULE(ata, atapci, ata_pcisub_driver, ata_devclass, 0, 0);
+DRIVER_MODULE(ata, atapci, ata_channel_driver, ata_devclass, 0, 0);
==== //depot/projects/netperf_socket/sys/dev/pccbb/pccbb.c#13 (text+ko) ====
@@ -59,6 +59,9 @@
/*
* Driver for PCI to CardBus Bridge chips
+ * and PCI to PCMCIA Bridge chips
+ * and ISA to PCMCIA host adapters
+ * and C Bus to PCMCIA host adapters
*
* References:
* TI Datasheets:
@@ -73,23 +76,23 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.116 2004/07/22 20:19:57 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.117 2004/08/12 06:50:29 imp Exp $");
#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
+#include <sys/bus.h>
#include <sys/condvar.h>
#include <sys/errno.h>
#include <sys/kernel.h>
#include <sys/module.h>
+#include <sys/kthread.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/rman.h>
#include <sys/sysctl.h>
-#include <sys/kthread.h>
-#include <sys/bus.h>
+#include <sys/systm.h>
#include <machine/bus.h>
-#include <sys/rman.h>
#include <machine/resource.h>
#include <dev/pci/pcireg.h>
@@ -124,91 +127,8 @@
#define CBB_START_32_IO 0x1000
#define CBB_START_16_IO 0x100
-struct yenta_chipinfo {
- uint32_t yc_id;
- const char *yc_name;
- int yc_chiptype;
-} yc_chipsets[] = {
- /* Texas Instruments chips */
- {PCIC_ID_TI1031, "TI1031 PCI-PC Card Bridge", CB_TI113X},
- {PCIC_ID_TI1130, "TI1130 PCI-CardBus Bridge", CB_TI113X},
- {PCIC_ID_TI1131, "TI1131 PCI-CardBus Bridge", CB_TI113X},
-
- {PCIC_ID_TI1210, "TI1210 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1211, "TI1211 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1220, "TI1220 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1221, "TI1221 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1225, "TI1225 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1250, "TI1250 PCI-CardBus Bridge", CB_TI125X},
- {PCIC_ID_TI1251, "TI1251 PCI-CardBus Bridge", CB_TI125X},
- {PCIC_ID_TI1251B,"TI1251B PCI-CardBus Bridge",CB_TI125X},
- {PCIC_ID_TI1260, "TI1260 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1260B,"TI1260B PCI-CardBus Bridge",CB_TI12XX},
- {PCIC_ID_TI1410, "TI1410 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1420, "TI1420 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1421, "TI1421 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1450, "TI1450 PCI-CardBus Bridge", CB_TI125X}, /*SIC!*/
- {PCIC_ID_TI1451, "TI1451 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1510, "TI1510 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1515, "TI1515 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1520, "TI1520 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1530, "TI1530 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI1620, "TI1620 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI4410, "TI4410 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI4450, "TI4450 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI4451, "TI4451 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI4510, "TI4510 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI4520, "TI4520 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI6411, "TI[67]x[12]1 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI6420, "TI[67]x20 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI6420SC, "TI[67]x20 (SC) PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI7410, "TI7410 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI7510, "TI7510 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI7610, "TI7610 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI7610M, "TI7610 (M) PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI7610SD, "TI7610 (SD) PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_TI7610MS, "TI7610 (MS) PCI-CardBus Bridge", CB_TI12XX},
-
- /* ENE */
- {PCIC_ID_ENE_CB710, "ENE CB710 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_ENE_CB720, "ENE CB720 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_ENE_CB1211, "ENE CB1211 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_ENE_CB1225, "ENE CB1225 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_ENE_CB1410, "ENE CB1410 PCI-CardBus Bridge", CB_TI12XX},
- {PCIC_ID_ENE_CB1420, "ENE CB1420 PCI-CardBus Bridge", CB_TI12XX},
-
- /* Ricoh chips */
- {PCIC_ID_RICOH_RL5C465, "RF5C465 PCI-CardBus Bridge", CB_RF5C46X},
- {PCIC_ID_RICOH_RL5C466, "RF5C466 PCI-CardBus Bridge", CB_RF5C46X},
- {PCIC_ID_RICOH_RL5C475, "RF5C475 PCI-CardBus Bridge", CB_RF5C47X},
- {PCIC_ID_RICOH_RL5C476, "RF5C476 PCI-CardBus Bridge", CB_RF5C47X},
- {PCIC_ID_RICOH_RL5C477, "RF5C477 PCI-CardBus Bridge", CB_RF5C47X},
- {PCIC_ID_RICOH_RL5C478, "RF5C478 PCI-CardBus Bridge", CB_RF5C47X},
-
- /* Toshiba products */
- {PCIC_ID_TOPIC95, "ToPIC95 PCI-CardBus Bridge", CB_TOPIC95},
- {PCIC_ID_TOPIC95B, "ToPIC95B PCI-CardBus Bridge", CB_TOPIC95},
- {PCIC_ID_TOPIC97, "ToPIC97 PCI-CardBus Bridge", CB_TOPIC97},
- {PCIC_ID_TOPIC100, "ToPIC100 PCI-CardBus Bridge", CB_TOPIC97},
-
- /* Cirrus Logic */
- {PCIC_ID_CLPD6832, "CLPD6832 PCI-CardBus Bridge", CB_CIRRUS},
- {PCIC_ID_CLPD6833, "CLPD6833 PCI-CardBus Bridge", CB_CIRRUS},
- {PCIC_ID_CLPD6834, "CLPD6834 PCI-CardBus Bridge", CB_CIRRUS},
-
- /* 02Micro */
- {PCIC_ID_OZ6832, "O2Micro OZ6832/6833 PCI-CardBus Bridge", CB_O2MICRO},
- {PCIC_ID_OZ6860, "O2Micro OZ6836/6860 PCI-CardBus Bridge", CB_O2MICRO},
- {PCIC_ID_OZ6872, "O2Micro OZ6812/6872 PCI-CardBus Bridge", CB_O2MICRO},
- {PCIC_ID_OZ6912, "O2Micro OZ6912/6972 PCI-CardBus Bridge", CB_O2MICRO},
- {PCIC_ID_OZ6922, "O2Micro OZ6922 PCI-CardBus Bridge", CB_O2MICRO},
- {PCIC_ID_OZ6933, "O2Micro OZ6933 PCI-CardBus Bridge", CB_O2MICRO},
- {PCIC_ID_OZ711E1, "O2Micro OZ711E1 PCI-CardBus Bridge", CB_O2MICRO},
+devclass_t cbb_devclass;
- /* sentinel */
- {0 /* null id */, "unknown", CB_UNKNOWN},
-};
-
/* sysctl vars */
SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters");
@@ -236,25 +156,10 @@
SYSCTL_ULONG(_hw_cbb, OID_AUTO, debug, CTLFLAG_RW, &cbb_debug, 0,
"Verbose cardbus bridge debugging");
-static int cbb_chipset(uint32_t pci_id, const char **namep);
-static int cbb_probe(device_t brdev);
-static void cbb_chipinit(struct cbb_softc *sc);
-static int cbb_attach(device_t brdev);
-static int cbb_detach(device_t brdev);
-static int cbb_shutdown(device_t brdev);
-static void cbb_driver_added(device_t brdev, driver_t *driver);
-static void cbb_child_detached(device_t brdev, device_t child);
-static void cbb_event_thread(void *arg);
static void cbb_insert(struct cbb_softc *sc);
static void cbb_removal(struct cbb_softc *sc);
-static void cbb_intr(void *arg);
static int cbb_detect_voltage(device_t brdev);
-static int cbb_power(device_t brdev, int volts);
static void cbb_cardbus_reset(device_t brdev);
-static int cbb_cardbus_power_enable_socket(device_t brdev,
- device_t child);
-static void cbb_cardbus_power_disable_socket(device_t brdev,
- device_t child);
static int cbb_cardbus_io_open(device_t brdev, int win, uint32_t start,
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list