svn commit: r188570 - head/sys/cam
Author: scottl Date: Fri Feb 13 10:04:59 2009 New Revision: 188570 URL: http://svn.freebsd.org/changeset/base/188570 Log: In the case that the probe has determined that it can't query the device for a serial number, fall through to the next case so that initial negotiation still happens. Without this, devices were showing up with only 1 available tag opening, leading to observations of very poor I/O performance. This should fix problems reported with VMWare Fusion and ESX. Early generation MPT-SAS controllers with SATA disks might also be affected. HP CISS controllers are also likely affected, as are many other pseudo-scsi disk subsystems. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c == --- head/sys/cam/cam_xpt.c Fri Feb 13 06:17:53 2009(r188569) +++ head/sys/cam/cam_xpt.c Fri Feb 13 10:04:59 2009(r188570) @@ -6143,10 +6143,9 @@ probedone(struct cam_periph *periph, uni xpt_schedule(periph, priority); return; } - xpt_release_ccb(done_ccb); - softc->action = PROBE_TUR_FOR_NEGOTIATION; - xpt_schedule(periph, priority); - return; + + csio->data_ptr = NULL; + /* FALLTHROUGH */ } case PROBE_SERIAL_NUM_1: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188571 - head/sys/kern
Author: luigi Date: Fri Feb 13 11:36:32 2009 New Revision: 188571 URL: http://svn.freebsd.org/changeset/base/188571 Log: Clarify and reimplement the bioq API so that bioq_disksort() has the correct behaviour (sorting by distance from the current head position in the scan direction) and bioq_insert_head() and bioq_insert_tail() have a well defined (and useful) behaviour, especially when intermixed with calls to bioq_disksort(). In particular: - fix a bug in the existing bioq_disksort() that did not use the current head position correctly; - redefine semantics of bioq_insert_head() and bioq_insert_tail(). bioq_insert_tail() can now be used as a barrier between previous and subsequent calls to bioq_disksort(). The code is heavily documented in the source code so please refer to that for the details. Much of this code comes from Fabio Checconi. Also thanks to Kirk for feedback on the (re)definition of bioq_insert_tail(). NOTE: in the current tree there is only a handful of files which intermix calls to bioq_disksort() with bioq_insert_head() and bioq_insert_tail(). The ordering of the queue in these situation was not specified (nor easy to figure out) before, so I doubt any of that code could be affected by the specification of the API. Also note that the current implementation is significantly simpler than the previous one (also used in ata_sort_queue()). It would be useful to reimplement ata_sort_queue() using the same code used in bioq_disksort(). MFC after:1 week Modified: head/sys/kern/subr_disk.c Modified: head/sys/kern/subr_disk.c == --- head/sys/kern/subr_disk.c Fri Feb 13 10:04:59 2009(r188570) +++ head/sys/kern/subr_disk.c Fri Feb 13 11:36:32 2009(r188571) @@ -5,6 +5,10 @@ * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * + * + * The bioq_disksort() (and the specification of the bioq API) + * have been written by Luigi Rizzo and Fabio Checconi under the same + * license as above. */ #include @@ -63,11 +67,86 @@ disk_err(struct bio *bp, const char *wha /* * BIO queue implementation + * + * Please read carefully the description below before making any change + * to the code, or you might change the behaviour of the data structure + * in undesirable ways. + * + * A bioq stores disk I/O request (bio), normally sorted according to + * the distance of the requested position (bio->bio_offset) from the + * current head position (bioq->last_offset) in the scan direction, i.e. + * + * (uoff_t)(bio_offset - last_offset) + * + * Note that the cast to unsigned (uoff_t) is fundamental to insure + * that the distance is computed in the scan direction. + * + * The main methods for manipulating the bioq are: + * + * bioq_disksort() performs an ordered insertion; + * + * bioq_first() return the head of the queue, without removing; + * + * bioq_takefirst() return and remove the head of the queue, + * updating the 'current head position' as + * bioq->last_offset = bio->bio_offset + bio->bio_length; + * + * When updating the 'current head position', we assume that the result of + * bioq_takefirst() is dispatched to the device, so bioq->last_offset + * represents the head position once the request is complete. + * + * If the bioq is manipulated using only the above calls, it starts + * with a sorted sequence of requests with bio_offset >= last_offset, + * possibly followed by another sorted sequence of requests with + * 0 <= bio_offset < bioq->last_offset + * + * NOTE: historical behaviour was to ignore bio->bio_length in the + * update, but its use tracks the head position in a better way. + * Historical behaviour was also to update the head position when + * the request under service is complete, rather than when the + * request is extracted from the queue. However, the current API + * has no method to update the head position; secondly, once + * a request has been submitted to the disk, we have no idea of + * the actual head position, so the final one is our best guess. + * + * --- Direct queue manipulation --- + * + * A bioq uses an underlying TAILQ to store requests, so we also + * export methods to manipulate the TAILQ, in particular: + * + * bioq_insert_tail() insert an entry at the end. + * It also creates a 'barrier' so all subsequent + * insertions through bioq_disksort() will end up + * after this entry; + * + * bioq_insert_head() insert an entry at the head, update + * bioq->last_offset = bio->bio_offset so that + * all subsequent insertions through bioq_disksort() + * will end up after this
svn commit: r188572 - head/sys/compat/linux
Author: netchild Date: Fri Feb 13 11:55:19 2009 New Revision: 188572 URL: http://svn.freebsd.org/changeset/base/188572 Log: Fix an edge-case of the linux readdir: We need the size of a linux dirent structure, not the size of a pointer to it. PR: 131099 Submitted by: Andreas Kies MFC after:2 weeks Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c == --- head/sys/compat/linux/linux_file.c Fri Feb 13 11:36:32 2009 (r188571) +++ head/sys/compat/linux/linux_file.c Fri Feb 13 11:55:19 2009 (r188572) @@ -345,7 +345,7 @@ getdents_common(struct thread *td, struc /* readdir(2) case. Always struct dirent. */ if (is64bit) return (EINVAL); - nbytes = sizeof(linux_dirent); + nbytes = sizeof(*linux_dirent); justone = 1; } else justone = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188574 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern
Author: kib Date: Fri Feb 13 12:15:45 2009 New Revision: 188574 URL: http://svn.freebsd.org/changeset/base/188574 Log: MFC r187223: Redo the locking of the semaphores lifetime cycle. MFC r187298: Lock the semaphore identifier lock during semaphore initialization. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/sysv_sem.c Modified: stable/7/sys/kern/sysv_sem.c == --- stable/7/sys/kern/sysv_sem.cFri Feb 13 12:07:45 2009 (r188573) +++ stable/7/sys/kern/sysv_sem.cFri Feb 13 12:15:45 2009 (r188574) @@ -88,7 +88,7 @@ int semop(struct thread *td, struct semo static struct sem_undo *semu_alloc(struct thread *td); static int semundo_adjust(struct thread *td, struct sem_undo **supptr, - int semid, int semnum, int adjval); +int semid, int semseq, int semnum, int adjval); static void semundo_clear(int semid, int semnum); /* XXX casting to (sy_call_t *) is bogus, as usual. */ @@ -98,15 +98,17 @@ static sy_call_t *semcalls[] = { }; static struct mtx sem_mtx;/* semaphore global lock */ +static struct mtx sem_undo_mtx; static int semtot = 0; static struct semid_kernel *sema; /* semaphore id pool */ static struct mtx *sema_mtx; /* semaphore id pool mutexes*/ static struct sem *sem;/* semaphore pool */ -SLIST_HEAD(, sem_undo) semu_list; /* list of active undo structures */ +LIST_HEAD(, sem_undo) semu_list; /* list of active undo structures */ +LIST_HEAD(, sem_undo) semu_free_list; /* list of free undo structures */ static int *semu; /* undo structure pool */ static eventhandler_tag semexit_tag; -#define SEMUNDO_MTXsem_mtx +#define SEMUNDO_MTXsem_undo_mtx #define SEMUNDO_LOCK() mtx_lock(&SEMUNDO_MTX); #define SEMUNDO_UNLOCK() mtx_unlock(&SEMUNDO_MTX); #define SEMUNDO_LOCKASSERT(how)mtx_assert(&SEMUNDO_MTX, (how)); @@ -122,13 +124,14 @@ struct sem { * Undo structure (one per process) */ struct sem_undo { - SLIST_ENTRY(sem_undo) un_next; /* ptr to next active undo structure */ + LIST_ENTRY(sem_undo) un_next; /* ptr to next active undo structure */ struct proc *un_proc; /* owner of this structure */ short un_cnt; /* # of active entries */ struct undo { short un_adjval; /* adjust on exit values */ short un_num; /* semaphore # */ int un_id; /* semid */ + unsigned short un_seq; } un_ent[1];/* undo entries */ }; @@ -250,12 +253,15 @@ seminit(void) } for (i = 0; i < seminfo.semmni; i++) mtx_init(&sema_mtx[i], "semid", NULL, MTX_DEF); + LIST_INIT(&semu_free_list); for (i = 0; i < seminfo.semmnu; i++) { struct sem_undo *suptr = SEMU(i); suptr->un_proc = NULL; + LIST_INSERT_HEAD(&semu_free_list, suptr, un_next); } - SLIST_INIT(&semu_list); + LIST_INIT(&semu_list); mtx_init(&sem_mtx, "sem", NULL, MTX_DEF); + mtx_init(&sem_undo_mtx, "semu", NULL, MTX_DEF); semexit_tag = EVENTHANDLER_REGISTER(process_exit, semexit_myhook, NULL, EVENTHANDLER_PRI_ANY); } @@ -265,6 +271,7 @@ semunload(void) { int i; + /* XXXKIB */ if (semtot != 0) return (EBUSY); @@ -279,6 +286,7 @@ semunload(void) for (i = 0; i < seminfo.semmni; i++) mtx_destroy(&sema_mtx[i]); mtx_destroy(&sem_mtx); + mtx_destroy(&sem_undo_mtx); return (0); } @@ -350,69 +358,31 @@ semsys(td, uap) */ static struct sem_undo * -semu_alloc(td) - struct thread *td; +semu_alloc(struct thread *td) { - int i; struct sem_undo *suptr; - struct sem_undo **supptr; - int attempt; SEMUNDO_LOCKASSERT(MA_OWNED); - /* -* Try twice to allocate something. -* (we'll purge an empty structure after the first pass so -* two passes are always enough) -*/ - - for (attempt = 0; attempt < 2; attempt++) { - /* -* Look for a free structure. -* Fill it in and return it if we find one. -*/ - - for (i = 0; i < seminfo.semmnu; i++) { - suptr = SEMU(i); - if (suptr->un_proc == NULL) { - SLIST_INSERT_HEAD(&semu_list, suptr, un_next); - suptr->un_cnt = 0; - suptr->un_proc = td->td_proc; - return(suptr); - } - } +
svn commit: r188575 - head/sys/net
Author: maxim Date: Fri Feb 13 12:59:54 2009 New Revision: 188575 URL: http://svn.freebsd.org/changeset/base/188575 Log: o In case of the error do not forget to deallocate a cloned device unit. PR: kern/131642 Submitted by: Dmitrij Tejblum MFC after:1 week Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c == --- head/sys/net/if_vlan.c Fri Feb 13 12:15:45 2009(r188574) +++ head/sys/net/if_vlan.c Fri Feb 13 12:59:54 2009(r188575) @@ -746,6 +746,7 @@ vlan_clone_create(struct if_clone *ifc, ether_ifdetach(ifp); vlan_unconfig(ifp); if_free_type(ifp, IFT_ETHER); + ifc_free_unit(ifc, unit); free(ifv, M_VLAN); return (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188576 - stable/7/sys/netinet
Author: luigi Date: Fri Feb 13 13:35:41 2009 New Revision: 188576 URL: http://svn.freebsd.org/changeset/base/188576 Log: remove some unnecessary #include The change is not directly applicable to HEAD because there a lot of headers are already included by vnet.h Modified: stable/7/sys/netinet/ip_dummynet.c stable/7/sys/netinet/ip_fw2.c Modified: stable/7/sys/netinet/ip_dummynet.c == --- stable/7/sys/netinet/ip_dummynet.c Fri Feb 13 12:59:54 2009 (r188575) +++ stable/7/sys/netinet/ip_dummynet.c Fri Feb 13 13:35:41 2009 (r188576) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -81,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* for struct arpcom */ +#include /* various ether_* routines */ #include/* for ip6_input, ip6_output prototypes */ #include Modified: stable/7/sys/netinet/ip_fw2.c == --- stable/7/sys/netinet/ip_fw2.c Fri Feb 13 12:59:54 2009 (r188575) +++ stable/7/sys/netinet/ip_fw2.c Fri Feb 13 13:35:41 2009 (r188576) @@ -83,17 +83,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include -#include #include #include #include #include -#include - #include #include #ifdef INET6 @@ -104,7 +99,9 @@ __FBSDID("$FreeBSD$"); #include /* XXX for in_cksum */ +#ifdef MAC #include +#endif /* * set_disable contains one bit per set value (0..31). ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188577 - head/sys/netinet
Author: rrs Date: Fri Feb 13 14:43:46 2009 New Revision: 188577 URL: http://svn.freebsd.org/changeset/base/188577 Log: Move the new rwnd field down to the very end of the xsctp structure. This is where all new fields belong (not that we will be ABI compatiable with 7.x anyway.. sigh). Modified: head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_sysctl.c == --- head/sys/netinet/sctp_sysctl.c Fri Feb 13 13:35:41 2009 (r188576) +++ head/sys/netinet/sctp_sysctl.c Fri Feb 13 14:43:46 2009 (r188577) @@ -409,8 +409,9 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xstcb.primary_addr = stcb->asoc.primary_destination->ro._l_addr; xstcb.heartbeat_interval = stcb->asoc.heart_beat_delay; xstcb.state = SCTP_GET_STATE(&stcb->asoc); /* FIXME */ - /* 7.0 does not support this */ + /* 7.0 does not support these */ xstcb.assoc_id = sctp_get_associd(stcb); + xstcb.peers_rwnd = stcb->asoc.peers_rwnd; xstcb.in_streams = stcb->asoc.streamincnt; xstcb.out_streams = stcb->asoc.streamoutcnt; xstcb.max_nr_retrans = stcb->asoc.overall_error_count; @@ -432,7 +433,6 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xstcb.cumulative_tsn = stcb->asoc.last_acked_seq; xstcb.cumulative_tsn_ack = stcb->asoc.cumulative_tsn; xstcb.mtu = stcb->asoc.smallest_mtu; - xstcb.peers_rwnd = stcb->asoc.peers_rwnd; xstcb.refcnt = stcb->asoc.refcnt; SCTP_INP_RUNLOCK(inp); SCTP_INP_INFO_RUNLOCK(); Modified: head/sys/netinet/sctp_uio.h == --- head/sys/netinet/sctp_uio.h Fri Feb 13 13:35:41 2009(r188576) +++ head/sys/netinet/sctp_uio.h Fri Feb 13 14:43:46 2009(r188577) @@ -1011,12 +1011,12 @@ struct xsctp_tcb { uint32_t cumulative_tsn; uint32_t cumulative_tsn_ack; uint32_t mtu; - uint32_t peers_rwnd; uint32_t refcnt; uint16_t local_port;/* sctpAssocEntry 3 */ uint16_t remote_port; /* sctpAssocEntry 4 */ struct sctp_timeval start_time; /* sctpAssocEntry 16 */ struct sctp_timeval discontinuity_time; /* sctpAssocEntry 17 */ + uint32_t peers_rwnd; sctp_assoc_t assoc_id; /* sctpAssocEntry 1 */ uint32_t extra_padding[8]; /* future */ }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r188570 - head/sys/cam
Hello, Scott Long wrote: Author: scottl Date: Fri Feb 13 10:04:59 2009 New Revision: 188570 URL: http://svn.freebsd.org/changeset/base/188570 Log: In the case that the probe has determined that it can't query the device for a serial number, fall through to the next case so that initial negotiation still happens. Without this, devices were showing up with only 1 available tag opening, leading to observations of very poor I/O performance. This should fix problems reported with VMWare Fusion and ESX. Early generation MPT-SAS controllers with SATA disks might also be affected. HP CISS controllers are also likely affected, as are many other pseudo-scsi disk subsystems. Is it possible that these two are related? http://marc.info/?l=freebsd-scsi&m=122900270413265&w=2 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188578 - head/sys/netinet
Author: luigi Date: Fri Feb 13 15:14:43 2009 New Revision: 188578 URL: http://svn.freebsd.org/changeset/base/188578 Log: Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. Add a note next to fields in network format. The n_* types are not enough for compiler checks on endianness, and their use often requires an otherwise unnecessary #include The typedef in in_systm.h are still there. Modified: head/sys/netinet/in_systm.h head/sys/netinet/ip.h head/sys/netinet/ip_icmp.c head/sys/netinet/ip_icmp.h head/sys/netinet/ip_options.c head/sys/netinet/tcp_debug.h head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/in_systm.h == --- head/sys/netinet/in_systm.h Fri Feb 13 14:43:46 2009(r188577) +++ head/sys/netinet/in_systm.h Fri Feb 13 15:14:43 2009(r188578) @@ -52,7 +52,7 @@ typedef u_int32_t n_long; /* long as re typedefu_int32_t n_time; /* ms since 00:00 GMT, byte rev */ #ifdef _KERNEL -n_time iptime(void); +uint32_tiptime(void); #endif #endif Modified: head/sys/netinet/ip.h == --- head/sys/netinet/ip.h Fri Feb 13 14:43:46 2009(r188577) +++ head/sys/netinet/ip.h Fri Feb 13 15:14:43 2009(r188578) @@ -150,10 +150,10 @@ structip_timestamp { ipt_flg:4; /* flags, see below */ #endif union ipt_timestamp { - n_long ipt_time[1]; + uint32_tipt_time[1];/* network format */ struct ipt_ta { struct in_addr ipt_addr; - n_long ipt_time; + uint32_t ipt_time; /* network format */ } ipt_ta[1]; } ipt_timestamp; }; Modified: head/sys/netinet/ip_icmp.c == --- head/sys/netinet/ip_icmp.c Fri Feb 13 14:43:46 2009(r188577) +++ head/sys/netinet/ip_icmp.c Fri Feb 13 15:14:43 2009(r188578) @@ -165,7 +165,7 @@ icmp_init(void) * in response to bad packet ip. */ void -icmp_error(struct mbuf *n, int type, int code, n_long dest, int mtu) +icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu) { INIT_VNET_INET(curvnet); register struct ip *oip = mtod(n, struct ip *), *nip; @@ -852,7 +852,10 @@ icmp_send(struct mbuf *m, struct mbuf *o (void) ip_output(m, opts, NULL, 0, NULL, NULL); } -n_time +/* + * Return milliseconds since 00:00 GMT in network format. + */ +uint32_t iptime(void) { struct timeval atv; Modified: head/sys/netinet/ip_icmp.h == --- head/sys/netinet/ip_icmp.h Fri Feb 13 14:43:46 2009(r188577) +++ head/sys/netinet/ip_icmp.h Fri Feb 13 15:14:43 2009(r188578) @@ -68,15 +68,15 @@ struct icmp { u_char ih_pptr; /* ICMP_PARAMPROB */ struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ struct ih_idseq { - n_short icd_id; - n_short icd_seq; + uint16_ticd_id; /* network format */ + uint16_ticd_seq; /* network format */ } ih_idseq; int ih_void; /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ struct ih_pmtu { - n_short ipm_void; - n_short ipm_nextmtu; + uint16_t ipm_void; /* network format */ + uint16_t ipm_nextmtu; /* network format */ } ih_pmtu; struct ih_rtradv { @@ -97,9 +97,13 @@ struct icmp { #defineicmp_lifetime icmp_hun.ih_rtradv.irt_lifetime union { struct id_ts { /* ICMP Timestamp */ - n_time its_otime; /* Originate */ - n_time its_rtime; /* Receive */ - n_time its_ttime; /* Transmit */ + /* +* The next 3 fields are in network format, +* milliseconds since 00:00 GMT +*/ + uint32_t its_otime; /* Originate */ + uint32_t its_rtime; /* Receive */ + uint32_t its_ttime; /* Transmit */ } id_ts; struct id_ip { struct ip idi_ip; @@ -127,7 +131,7 @@ struct icmp { * ip header length. */ #defineICMP_MINLEN 8 /* abs minimum */ -#defineICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ +#defineICMP_TSLEN
svn commit: r188579 - head/sys/compat/linprocfs
Author: jhb Date: Fri Feb 13 15:32:03 2009 New Revision: 188579 URL: http://svn.freebsd.org/changeset/base/188579 Log: Fix a bug in the previous change to the mtab handler: use the path returned by vn_fullpath() when vn_fullpath() succeeds instead of when it fails. Submitted by: Artem Belevich fbsdlist of src.cx MFC after:3 days Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c == --- head/sys/compat/linprocfs/linprocfs.c Fri Feb 13 15:14:43 2009 (r188578) +++ head/sys/compat/linprocfs/linprocfs.c Fri Feb 13 15:32:03 2009 (r188579) @@ -327,7 +327,7 @@ linprocfs_domtab(PFS_FILL_ARGS) error = namei(&nd); lep = linux_emul_path; if (error == 0) { - if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) + if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0) lep = dlep; vrele(nd.ni_vp); VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188580 - head/sys/netinet
Author: luigi Date: Fri Feb 13 15:37:14 2009 New Revision: 188580 URL: http://svn.freebsd.org/changeset/base/188580 Log: remove unnecessary #include, and document some of the others Modified: head/sys/netinet/ip_dummynet.c head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_dummynet.c == --- head/sys/netinet/ip_dummynet.c Fri Feb 13 15:32:03 2009 (r188579) +++ head/sys/netinet/ip_dummynet.c Fri Feb 13 15:37:14 2009 (r188580) @@ -72,18 +72,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ #include -#include #include -#include -#include -#include +#include /* ip_len, ip_off */ #include #include -#include +#include /* ip_output(), IP_FORWARDING */ -#include /* for struct arpcom */ +#include /* various ether_* routines */ #include/* for ip6_input, ip6_output prototypes */ #include @@ -157,6 +154,9 @@ static struct callout dn_timeout; extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *); #ifdef SYSCTL_NODE +SYSCTL_DECL(_net_inet); +SYSCTL_DECL(_net_inet_ip); + SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, hash_size, CTLFLAG_RW, &dn_hash_size, 0, "Default hash table size"); @@ -892,7 +892,7 @@ dummynet_send(struct mbuf *m) case DN_TO_IP_OUT: ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); break ; - case DN_TO_IP_IN : + case DN_TO_IP_IN : ip = mtod(m, struct ip *); ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); Modified: head/sys/netinet/ip_fw2.c == --- head/sys/netinet/ip_fw2.c Fri Feb 13 15:32:03 2009(r188579) +++ head/sys/netinet/ip_fw2.c Fri Feb 13 15:37:14 2009(r188580) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #defineIPFW_INTERNAL /* Access to protected data structures in ip_fw.h. */ #include -#include #include #include #include @@ -85,10 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include -#include #include #include #include @@ -96,8 +92,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #include #include #ifdef INET6 @@ -108,7 +102,9 @@ __FBSDID("$FreeBSD$"); #include /* XXX for in_cksum */ +#ifdef MAC #include +#endif #ifndef VIMAGE #ifndef VIMAGE_GLOBALS ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188581 - head/sys/arm/arm
Author: cognet Date: Fri Feb 13 16:00:19 2009 New Revision: 188581 URL: http://svn.freebsd.org/changeset/base/188581 Log: Oops. ARM_RAS_END is ARM_TP_ADDRESS + 8, not 4. Spotted out by: Mark Tinguely Modified: head/sys/arm/arm/swtch.S Modified: head/sys/arm/arm/swtch.S == --- head/sys/arm/arm/swtch.SFri Feb 13 15:37:14 2009(r188580) +++ head/sys/arm/arm/swtch.SFri Feb 13 16:00:19 2009(r188581) @@ -210,7 +210,7 @@ ENTRY(cpu_throw) ldr r6, [r5, #(TD_MD + MD_RAS_START)] str r6, [r4, #4] /* ARM_RAS_START */ ldr r6, [r5, #(TD_MD + MD_RAS_END)] - str r6, [r4, #4] /* ARM_RAS_END */ + str r6, [r4, #8] /* ARM_RAS_END */ /* Hook in a new pcb */ ldr r6, .Lcurpcb ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188582 - in head/sys/dev: iwn wpi
Author: sam Date: Fri Feb 13 16:17:05 2009 New Revision: 188582 URL: http://svn.freebsd.org/changeset/base/188582 Log: remove references to ic_stats Spotted by: Lucius Windschuh Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Fri Feb 13 16:00:19 2009(r188581) +++ head/sys/dev/iwn/if_iwn.c Fri Feb 13 16:17:05 2009(r188582) @@ -1442,7 +1442,6 @@ iwn_rx_intr(struct iwn_softc *sc, struct if (len < sizeof (struct ieee80211_frame)) { DPRINTF(sc, IWN_DEBUG_RECV, "%s: frame too short: %d\n", __func__, len); - ic->ic_stats.is_rx_tooshort++; ifp->if_ierrors++; return; } @@ -1452,7 +1451,6 @@ iwn_rx_intr(struct iwn_softc *sc, struct if (mnew == NULL) { DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n", __func__); - ic->ic_stats.is_rx_nobuf++; ifp->if_ierrors++; return; } @@ -1463,7 +1461,6 @@ iwn_rx_intr(struct iwn_softc *sc, struct device_printf(sc->sc_dev, "%s: bus_dmamap_load failed, error %d\n", __func__, error); m_freem(mnew); - ic->ic_stats.is_rx_nobuf++; /* XXX need stat */ ifp->if_ierrors++; return; } Modified: head/sys/dev/wpi/if_wpi.c == --- head/sys/dev/wpi/if_wpi.c Fri Feb 13 16:00:19 2009(r188581) +++ head/sys/dev/wpi/if_wpi.c Fri Feb 13 16:17:05 2009(r188582) @@ -1478,7 +1478,6 @@ wpi_rx_intr(struct wpi_softc *sc, struct if (mnew == NULL) { DPRINTFN(WPI_DEBUG_RX, ("%s: no mbuf to restock ring\n", __func__)); - ic->ic_stats.is_rx_nobuf++; ifp->if_ierrors++; return; } @@ -1489,7 +1488,6 @@ wpi_rx_intr(struct wpi_softc *sc, struct device_printf(sc->sc_dev, "%s: bus_dmamap_load failed, error %d\n", __func__, error); m_freem(mnew); - ic->ic_stats.is_rx_nobuf++; /* XXX need stat */ ifp->if_ierrors++; return; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188583 - in head: gnu/lib/libgcc lib/libc_r lib/libkse lib/libthr
Author: jkim Date: Fri Feb 13 16:51:36 2009 New Revision: 188583 URL: http://svn.freebsd.org/changeset/base/188583 Log: Honor WITHOUT_INSTALLLIB in some places. Modified: head/gnu/lib/libgcc/Makefile head/lib/libc_r/Makefile head/lib/libkse/Makefile head/lib/libthr/Makefile Modified: head/gnu/lib/libgcc/Makefile == --- head/gnu/lib/libgcc/MakefileFri Feb 13 16:17:05 2009 (r188582) +++ head/gnu/lib/libgcc/MakefileFri Feb 13 16:51:36 2009 (r188583) @@ -332,8 +332,10 @@ all: lib${LIB}_eh_p.a _libinstall: _lib-eh-install _lib-eh-install: +.if ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_eh.a ${DESTDIR}${LIBDIR} +.endif .if ${MK_PROFILE} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_eh_p.a ${DESTDIR}${LIBDIR} Modified: head/lib/libc_r/Makefile == --- head/lib/libc_r/MakefileFri Feb 13 16:17:05 2009(r188582) +++ head/lib/libc_r/MakefileFri Feb 13 16:51:36 2009(r188583) @@ -33,7 +33,9 @@ PRECIOUSLIB= .include "${.CURDIR}/sys/Makefile.inc" .if ${DEFAULT_THREAD_LIB} == "libc_r" +.if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a +.endif .if !defined(NO_PIC) SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so .endif Modified: head/lib/libkse/Makefile == --- head/lib/libkse/MakefileFri Feb 13 16:17:05 2009(r188582) +++ head/lib/libkse/MakefileFri Feb 13 16:51:36 2009(r188583) @@ -52,7 +52,9 @@ PRECIOUSLIB= .include "${.CURDIR}/thread/Makefile.inc" .if ${DEFAULT_THREAD_LIB} == "libkse" || ${MK_LIBTHR} == "no" +.if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a +.endif .if !defined(NO_PIC) SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so .endif Modified: head/lib/libthr/Makefile == --- head/lib/libthr/MakefileFri Feb 13 16:17:05 2009(r188582) +++ head/lib/libthr/MakefileFri Feb 13 16:51:36 2009(r188583) @@ -44,7 +44,9 @@ PRECIOUSLIB= .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" +.if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a +.endif .if !defined(NO_PIC) SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188584 - head/sys/dev/firewire
Author: sbruno Date: Fri Feb 13 17:44:07 2009 New Revision: 188584 URL: http://svn.freebsd.org/changeset/base/188584 Log: Remove redundant while () from loop. Submitted by: Ganbold Reviewed by: scottl Modified: head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/fwohci.c == --- head/sys/dev/firewire/fwohci.c Fri Feb 13 16:51:36 2009 (r188583) +++ head/sys/dev/firewire/fwohci.c Fri Feb 13 17:44:07 2009 (r188584) @@ -2979,7 +2979,7 @@ err: db_tr = STAILQ_NEXT(db_tr, link); resCount = FWOHCI_DMA_READ(db_tr->db[0].db.desc.res) & OHCI_COUNT_MASK; - } while (resCount == 0) + } printf(" done\n"); dbch->top = db_tr; dbch->buf_offset = dbch->xferq.psize - resCount; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188585 - head/sys/dev/firewire
Author: sbruno Date: Fri Feb 13 17:45:09 2009 New Revision: 188585 URL: http://svn.freebsd.org/changeset/base/188585 Log: Update the Self ID structure to conform to 1394a-2000. Delete the unused defines. Reviewed by: scottl Modified: head/sys/dev/firewire/firewire.h Modified: head/sys/dev/firewire/firewire.h == --- head/sys/dev/firewire/firewire.hFri Feb 13 17:44:07 2009 (r188584) +++ head/sys/dev/firewire/firewire.hFri Feb 13 17:45:09 2009 (r188585) @@ -284,6 +284,10 @@ struct fw_devlstreq { struct fw_devinfo dev[FW_MAX_DEVLST]; }; +/* + * Defined in IEEE 1394a-2000 + * 4.3.4.1 + */ #define FW_SELF_ID_PORT_CONNECTED_TO_CHILD 3 #define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2 #define FW_SELF_ID_PORT_NOT_CONNECTED 1 @@ -312,18 +316,32 @@ union fw_self_id { phy_id:6, sequel:1, sequence_num:3, - :2, - porta:2, - portb:2, - portc:2, - portd:2, - porte:2, - portf:2, - portg:2, - porth:2, - :1, + reserved2:2, + port3:2, + port4:2, + port5:2, + port6:2, + port7:2, + port8:2, + port9:2, + port10:2, + reserved1:1, more_packets:1; } p1; + struct { + uint32_t + id:2, + phy_id:6, + sequel:1, + sequence_num:3, + :2, + port11:2, + port12:2, + port13:2, + port14:2, + port15:2, + :8; + } p2; }; #else union fw_self_id { @@ -346,20 +364,34 @@ union fw_self_id { struct { uint32_t more_packets:1, reserved1:1, - porth:2, - portg:2, - portf:2, - porte:2, - portd:2, - portc:2, - portb:2, - porta:2, + port10:2, + port9:2, + port8:2, + port7:2, + port6:2, + port5:2, + port4:2, + port3:2, reserved2:2, sequence_num:3, sequel:1, phy_id:6, id:2; } p1; + struct { + uint32_t + reserved3:8, + port15:2, + port14:2, + port13:2, + port12:2, + port11:2, + reserved4:2, + sequence_num:3, + sequel:1, + phy_id:6, + id:2; + } p2; }; #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188586 - stable/7/sys/netinet
Author: luigi Date: Fri Feb 13 18:04:55 2009 New Revision: 188586 URL: http://svn.freebsd.org/changeset/base/188586 Log: document why certain headers are required. Modified: stable/7/sys/netinet/ip_dummynet.c Modified: stable/7/sys/netinet/ip_dummynet.c == --- stable/7/sys/netinet/ip_dummynet.c Fri Feb 13 17:45:09 2009 (r188585) +++ stable/7/sys/netinet/ip_dummynet.c Fri Feb 13 18:04:55 2009 (r188586) @@ -70,15 +70,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ #include #include -#include -#include -#include +#include /* n_long, SYSCTL_DECL(_net) */ +#include /* ip_len, ip_off */ #include #include -#include +#include /* ip_output(), IP_FORWARDING */ #include /* various ether_* routines */ @@ -154,6 +153,9 @@ static struct callout dn_timeout; extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *); #ifdef SYSCTL_NODE +SYSCTL_DECL(_net_inet); +SYSCTL_DECL(_net_inet_ip); + SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, hash_size, CTLFLAG_RW, &dn_hash_size, 0, "Default hash table size"); @@ -889,7 +891,7 @@ dummynet_send(struct mbuf *m) case DN_TO_IP_OUT: ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); break ; - case DN_TO_IP_IN : + case DN_TO_IP_IN : ip = mtod(m, struct ip *); ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188587 - stable/7/sys/netinet
Author: luigi Date: Fri Feb 13 18:09:38 2009 New Revision: 188587 URL: http://svn.freebsd.org/changeset/base/188587 Log: MFC - replace usage of n_* types with uint*_t , to help removing unnecessary dependencies on in_systm.h Modified: stable/7/sys/netinet/in_systm.h stable/7/sys/netinet/ip.h stable/7/sys/netinet/ip_icmp.c stable/7/sys/netinet/ip_icmp.h stable/7/sys/netinet/ip_options.c stable/7/sys/netinet/tcp_debug.h stable/7/sys/netinet/tcp_subr.c Modified: stable/7/sys/netinet/in_systm.h == --- stable/7/sys/netinet/in_systm.h Fri Feb 13 18:04:55 2009 (r188586) +++ stable/7/sys/netinet/in_systm.h Fri Feb 13 18:09:38 2009 (r188587) @@ -52,7 +52,7 @@ typedef u_int32_t n_long; /* long as re typedefu_int32_t n_time; /* ms since 00:00 GMT, byte rev */ #ifdef _KERNEL -n_time iptime(void); +uint32_tiptime(void); #endif #endif Modified: stable/7/sys/netinet/ip.h == --- stable/7/sys/netinet/ip.h Fri Feb 13 18:04:55 2009(r188586) +++ stable/7/sys/netinet/ip.h Fri Feb 13 18:09:38 2009(r188587) @@ -159,10 +159,10 @@ structip_timestamp { ipt_flg:4; /* flags, see below */ #endif union ipt_timestamp { - n_long ipt_time[1]; + uint32_tipt_time[1];/* network format */ struct ipt_ta { struct in_addr ipt_addr; - n_long ipt_time; + uint32_t ipt_time; /* network format */ } ipt_ta[1]; } ipt_timestamp; }; Modified: stable/7/sys/netinet/ip_icmp.c == --- stable/7/sys/netinet/ip_icmp.c Fri Feb 13 18:04:55 2009 (r188586) +++ stable/7/sys/netinet/ip_icmp.c Fri Feb 13 18:09:38 2009 (r188587) @@ -141,7 +141,7 @@ extern struct protosw inetsw[]; * in response to bad packet ip. */ void -icmp_error(struct mbuf *n, int type, int code, n_long dest, int mtu) +icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu) { register struct ip *oip = mtod(n, struct ip *), *nip; register unsigned oiphlen = oip->ip_hl << 2; @@ -825,7 +825,10 @@ icmp_send(struct mbuf *m, struct mbuf *o (void) ip_output(m, opts, NULL, 0, NULL, NULL); } -n_time +/* + * Return milliseconds since 00:00 GMT in network format. + */ +uint32_t iptime(void) { struct timeval atv; Modified: stable/7/sys/netinet/ip_icmp.h == --- stable/7/sys/netinet/ip_icmp.h Fri Feb 13 18:04:55 2009 (r188586) +++ stable/7/sys/netinet/ip_icmp.h Fri Feb 13 18:09:38 2009 (r188587) @@ -68,15 +68,15 @@ struct icmp { u_char ih_pptr; /* ICMP_PARAMPROB */ struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ struct ih_idseq { - n_short icd_id; - n_short icd_seq; + uint16_ticd_id; /* network format */ + uint16_ticd_seq; /* network format */ } ih_idseq; int ih_void; /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ struct ih_pmtu { - n_short ipm_void; - n_short ipm_nextmtu; + uint16_t ipm_void; /* network format */ + uint16_t ipm_nextmtu; /* network format */ } ih_pmtu; struct ih_rtradv { @@ -97,9 +97,13 @@ struct icmp { #defineicmp_lifetime icmp_hun.ih_rtradv.irt_lifetime union { struct id_ts { /* ICMP Timestamp */ - n_time its_otime; /* Originate */ - n_time its_rtime; /* Receive */ - n_time its_ttime; /* Transmit */ + /* +* The next 3 fields are in network format, +* milliseconds since 00:00 GMT +*/ + uint32_t its_otime; /* Originate */ + uint32_t its_rtime; /* Receive */ + uint32_t its_ttime; /* Transmit */ } id_ts; struct id_ip { struct ip idi_ip; @@ -127,7 +131,7 @@ struct icmp { * ip header length. */ #defineICMP_MINLEN 8 /* abs minimum */ -#defineICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ +#defineICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp */ #define
svn commit: r188588 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs compat/linux compat/svr4 fs/coda i386/ibcs2 kern nfsserver
Author: jhb Date: Fri Feb 13 18:18:14 2009 New Revision: 188588 URL: http://svn.freebsd.org/changeset/base/188588 Log: Use shared vnode locks when invoking VOP_READDIR(). MFC after:1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_getcwd.c head/sys/compat/svr4/svr4_misc.c head/sys/fs/coda/coda_vnops.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/vfs_syscalls.c head/sys/nfsserver/nfs_serv.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 13 18:09:38 2009(r188587) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 13 18:18:14 2009(r188588) @@ -4697,8 +4697,8 @@ vop_listextattr { return (error); } - NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | MPSAFE, UIO_SYSSPACE, - ".", xvp, td); + NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKSHARED | MPSAFE, + UIO_SYSSPACE, ".", xvp, td); error = namei(&nd); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); Modified: head/sys/compat/linux/linux_file.c == --- head/sys/compat/linux/linux_file.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/compat/linux/linux_file.c Fri Feb 13 18:18:14 2009 (r188588) @@ -372,7 +372,7 @@ getdents_common(struct thread *td, struc buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; Modified: head/sys/compat/linux/linux_getcwd.c == --- head/sys/compat/linux/linux_getcwd.cFri Feb 13 18:09:38 2009 (r188587) +++ head/sys/compat/linux/linux_getcwd.cFri Feb 13 18:18:14 2009 (r188588) @@ -163,7 +163,7 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bu cn.cn_nameptr = ".."; cn.cn_namelen = 2; cn.cn_consume = 0; - cn.cn_lkflags = LK_EXCLUSIVE; + cn.cn_lkflags = LK_SHARED; /* * At this point, lvp is locked and will be unlocked by the lookup. Modified: head/sys/compat/svr4/svr4_misc.c == --- head/sys/compat/svr4/svr4_misc.cFri Feb 13 18:09:38 2009 (r188587) +++ head/sys/compat/svr4/svr4_misc.cFri Feb 13 18:18:14 2009 (r188588) @@ -278,7 +278,7 @@ svr4_sys_getdents64(td, uap) buflen = max(DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -447,7 +447,7 @@ svr4_sys_getdents(td, uap) buflen = min(MAXBSIZE, uap->nbytes); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); off = fp->f_offset; again: aiov.iov_base = buf; Modified: head/sys/fs/coda/coda_vnops.c == --- head/sys/fs/coda/coda_vnops.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/fs/coda/coda_vnops.c Fri Feb 13 18:18:14 2009 (r188588) @@ -1506,7 +1506,7 @@ coda_readdir(struct vop_readdir_args *ap */ CODADEBUG(CODA_READDIR, myprintf(("indirect readdir: fid = %s, " "refcnt = %d\n", coda_f2s(&cp->c_fid), vp->v_usecount));); - vn_lock(cp->c_ovp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(cp->c_ovp, LK_SHARED | LK_RETRY); error = VOP_READDIR(cp->c_ovp, uiop, cred, eofflag, ncookies, cookies); VOP_UNLOCK(cp->c_ovp, 0); Modified: head/sys/i386/ibcs2/ibcs2_misc.c == --- head/sys/i386/ibcs2/ibcs2_misc.cFri Feb 13 18:09:38 2009 (r188587) +++ head/sys/i386/ibcs2/ibcs2_misc.cFri Feb 13 18:18:14 2009 (r188588) @@ -356,7 +356,7 @@ ibcs2_getdents(td, uap) buflen = max(DIRBLKSIZ, uap->nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -518,7 +518,7 @@ ibcs2_read(td, uap) buflen = max(DIRBLKSIZ, uap->nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WA
svn commit: r188589 - stable/7/sys/netinet
Author: luigi Date: Fri Feb 13 18:31:35 2009 New Revision: 188589 URL: http://svn.freebsd.org/changeset/base/188589 Log: remove some unnecessary #include Again, this change is not directly applicable to HEAD due to the presence of vnet.h and vinet.h which bring in almost every network-related header. Modified: stable/7/sys/netinet/ip_dummynet.c stable/7/sys/netinet/ip_fw2.c stable/7/sys/netinet/ip_fw_pfil.c stable/7/sys/netinet/ip_input.c Modified: stable/7/sys/netinet/ip_dummynet.c == --- stable/7/sys/netinet/ip_dummynet.c Fri Feb 13 18:18:14 2009 (r188588) +++ stable/7/sys/netinet/ip_dummynet.c Fri Feb 13 18:31:35 2009 (r188589) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ #include #include -#include /* n_long, SYSCTL_DECL(_net) */ #include /* ip_len, ip_off */ #include #include Modified: stable/7/sys/netinet/ip_fw2.c == --- stable/7/sys/netinet/ip_fw2.c Fri Feb 13 18:18:14 2009 (r188588) +++ stable/7/sys/netinet/ip_fw2.c Fri Feb 13 18:31:35 2009 (r188589) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #defineIPFW_INTERNAL /* Access to protected data structures in ip_fw.h. */ #include -#include #include #include #include Modified: stable/7/sys/netinet/ip_fw_pfil.c == --- stable/7/sys/netinet/ip_fw_pfil.c Fri Feb 13 18:18:14 2009 (r188588) +++ stable/7/sys/netinet/ip_fw_pfil.c Fri Feb 13 18:31:35 2009 (r188589) @@ -46,15 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include -#include -#include #include #include #include Modified: stable/7/sys/netinet/ip_input.c == --- stable/7/sys/netinet/ip_input.c Fri Feb 13 18:18:14 2009 (r188588) +++ stable/7/sys/netinet/ip_input.c Fri Feb 13 18:31:35 2009 (r188589) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188590 - head/sys/netinet
Author: rrs Date: Fri Feb 13 18:44:30 2009 New Revision: 188590 URL: http://svn.freebsd.org/changeset/base/188590 Log: Have the jail code use the error returned to pass not constant errors. Obtained from:ja...@freebsd.org Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_pcb.c == --- head/sys/netinet/sctp_pcb.c Fri Feb 13 18:31:35 2009(r188589) +++ head/sys/netinet/sctp_pcb.c Fri Feb 13 18:44:30 2009(r188590) @@ -2649,9 +2649,9 @@ sctp_inpcb_bind(struct socket *so, struc * will transmute the ip address to the * proper value. */ - if (p && prison_local_ip4(p->td_ucred, &sin->sin_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip4(p->td_ucred, &sin->sin_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (sin->sin_addr.s_addr != INADDR_ANY) { bindall = 0; @@ -2680,10 +2680,10 @@ sctp_inpcb_bind(struct socket *so, struc * will transmute the ipv6 address to the * proper value. */ - if (p && prison_local_ip6(p->td_ucred, &sin6->sin6_addr, - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip6(p->td_ucred, &sin6->sin6_addr, + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { bindall = 0; Modified: head/sys/netinet/sctp_usrreq.c == --- head/sys/netinet/sctp_usrreq.c Fri Feb 13 18:31:35 2009 (r188589) +++ head/sys/netinet/sctp_usrreq.c Fri Feb 13 18:44:30 2009 (r188590) @@ -4088,9 +4088,8 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; break; } - if (td != NULL && prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr))) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #ifdef INET6 @@ -4101,10 +4100,9 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; break; } - if (td != NULL && prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #endif @@ -4133,9 +4131,8 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; break; } - if (td != NULL && prison_local_ip4(td->td_ucred, &(((s
svn commit: r188591 - head/sys/dev/usb
Author: thompsa Date: Fri Feb 13 18:45:36 2009 New Revision: 188591 URL: http://svn.freebsd.org/changeset/base/188591 Log: Add the Novatel U760. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsFri Feb 13 18:44:30 2009(r188590) +++ head/sys/dev/usb/usbdevsFri Feb 13 18:45:36 2009(r188591) @@ -1866,6 +1866,8 @@ product NOVATEL U720 0x2110 Merlin U720 product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL ZEROCD20x5030 Novatel ZeroCD +product NOVATEL U760 0x6000 Novatel U760 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188592 - head/sys/kern
Author: thompsa Date: Fri Feb 13 18:51:39 2009 New Revision: 188592 URL: http://svn.freebsd.org/changeset/base/188592 Log: Remove semicolon left in the last commit Spotted by: csjp Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c == --- head/sys/kern/subr_taskqueue.c Fri Feb 13 18:45:36 2009 (r188591) +++ head/sys/kern/subr_taskqueue.c Fri Feb 13 18:51:39 2009 (r188592) @@ -402,7 +402,7 @@ taskqueue_thread_loop(void *arg) while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { taskqueue_run(tq); TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); - }; + } /* rendezvous with thread that asked us to terminate */ tq->tq_tcount--; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r188587 - stable/7/sys/netinet
On Fri, 13 Feb 2009, Luigi Rizzo wrote: Author: luigi Date: Fri Feb 13 18:09:38 2009 New Revision: 188587 URL: http://svn.freebsd.org/changeset/base/188587 Log: MFC - replace usage of n_* types with uint*_t , to help removing unnecessary dependencies on in_systm.h As harmless as these changes may seem, insta-MFCs often come with unexpected side effects. A three day MFC wait will also never hurt for what are definitely not critical bug fixes :-). Robert N M Watson Computer Laboratory University of Cambridge Modified: stable/7/sys/netinet/in_systm.h stable/7/sys/netinet/ip.h stable/7/sys/netinet/ip_icmp.c stable/7/sys/netinet/ip_icmp.h stable/7/sys/netinet/ip_options.c stable/7/sys/netinet/tcp_debug.h stable/7/sys/netinet/tcp_subr.c Modified: stable/7/sys/netinet/in_systm.h == --- stable/7/sys/netinet/in_systm.h Fri Feb 13 18:04:55 2009 (r188586) +++ stable/7/sys/netinet/in_systm.h Fri Feb 13 18:09:38 2009 (r188587) @@ -52,7 +52,7 @@ typedef u_int32_t n_long; /* long as re typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */ #ifdef _KERNEL -n_time iptime(void); +uint32_tiptime(void); #endif #endif Modified: stable/7/sys/netinet/ip.h == --- stable/7/sys/netinet/ip.h Fri Feb 13 18:04:55 2009(r188586) +++ stable/7/sys/netinet/ip.h Fri Feb 13 18:09:38 2009(r188587) @@ -159,10 +159,10 @@ structip_timestamp { ipt_flg:4; /* flags, see below */ #endif union ipt_timestamp { - n_long ipt_time[1]; + uint32_tipt_time[1];/* network format */ struct ipt_ta { struct in_addr ipt_addr; - n_long ipt_time; + uint32_t ipt_time; /* network format */ } ipt_ta[1]; } ipt_timestamp; }; Modified: stable/7/sys/netinet/ip_icmp.c == --- stable/7/sys/netinet/ip_icmp.c Fri Feb 13 18:04:55 2009 (r188586) +++ stable/7/sys/netinet/ip_icmp.c Fri Feb 13 18:09:38 2009 (r188587) @@ -141,7 +141,7 @@ extern struct protosw inetsw[]; * in response to bad packet ip. */ void -icmp_error(struct mbuf *n, int type, int code, n_long dest, int mtu) +icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu) { register struct ip *oip = mtod(n, struct ip *), *nip; register unsigned oiphlen = oip->ip_hl << 2; @@ -825,7 +825,10 @@ icmp_send(struct mbuf *m, struct mbuf *o (void) ip_output(m, opts, NULL, 0, NULL, NULL); } -n_time +/* + * Return milliseconds since 00:00 GMT in network format. + */ +uint32_t iptime(void) { struct timeval atv; Modified: stable/7/sys/netinet/ip_icmp.h == --- stable/7/sys/netinet/ip_icmp.h Fri Feb 13 18:04:55 2009 (r188586) +++ stable/7/sys/netinet/ip_icmp.h Fri Feb 13 18:09:38 2009 (r188587) @@ -68,15 +68,15 @@ struct icmp { u_char ih_pptr; /* ICMP_PARAMPROB */ struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ struct ih_idseq { - n_short icd_id; - n_short icd_seq; + uint16_ticd_id; /* network format */ + uint16_ticd_seq; /* network format */ } ih_idseq; int ih_void; /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ struct ih_pmtu { - n_short ipm_void; - n_short ipm_nextmtu; + uint16_t ipm_void; /* network format */ + uint16_t ipm_nextmtu; /* network format */ } ih_pmtu; struct ih_rtradv { @@ -97,9 +97,13 @@ struct icmp { #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime union { struct id_ts { /* ICMP Timestamp */ - n_time its_otime; /* Originate */ - n_time its_rtime; /* Receive */ - n_time its_ttime; /* Transmit */ + /* +* The next 3 fields are in network format, +* milliseconds since 00:00 GMT +*/ + uint32_t its_otime; /* Originate */ + uint32_t its_rtime; /* Receive */ + uint32_t its_ttime; /* Transmit */ } id_ts; struct id_ip { struct ip idi_ip; @@ -127,7 +131,7 @@ struct icmp { * ip header length. */
svn commit: r188593 - stable/7/sbin/route
Author: mav Date: Fri Feb 13 19:16:15 2009 New Revision: 188593 URL: http://svn.freebsd.org/changeset/base/188593 Log: MFC rev. 187384 Fix regression introduced at rev. 173124: 0.0.0.0/1 is not the same as 0.0.0.0/0. Modified: stable/7/sbin/route/ (props changed) stable/7/sbin/route/route.c Modified: stable/7/sbin/route/route.c == --- stable/7/sbin/route/route.c Fri Feb 13 18:51:39 2009(r188592) +++ stable/7/sbin/route/route.c Fri Feb 13 19:16:15 2009(r188593) @@ -797,33 +797,34 @@ inet_makenetandmask(net, sin, bits) char *cp; rtm_addrs |= RTA_NETMASK; - if (net == 0) - mask = addr = 0; - else { - if (net <= 0xff) - addr = net << IN_CLASSA_NSHIFT; - else if (net <= 0x) - addr = net << IN_CLASSB_NSHIFT; - else if (net <= 0xff) - addr = net << IN_CLASSC_NSHIFT; - else - addr = net; + /* +* XXX: This approach unable to handle 0.0.0.1/32 correctly +* as inet_network() converts 0.0.0.1 and 1 equally. +*/ + if (net <= 0xff) + addr = net << IN_CLASSA_NSHIFT; + else if (net <= 0x) + addr = net << IN_CLASSB_NSHIFT; + else if (net <= 0xff) + addr = net << IN_CLASSC_NSHIFT; + else + addr = net; + + if (bits != 0) + mask = 0x << (32 - bits); + else if (net == 0) + mask = 0; + else if (IN_CLASSA(addr)) + mask = IN_CLASSA_NET; + else if (IN_CLASSB(addr)) + mask = IN_CLASSB_NET; + else if (IN_CLASSC(addr)) + mask = IN_CLASSC_NET; + else if (IN_MULTICAST(addr)) + mask = IN_CLASSD_NET; + else + mask = 0x; - if (bits != 0) - mask = 0x << (32 - bits); - else { - if (IN_CLASSA(addr)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(addr)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(addr)) - mask = IN_CLASSC_NET; - else if (IN_MULTICAST(addr)) - mask = IN_CLASSD_NET; - else - mask = 0x; - } - } sin->sin_addr.s_addr = htonl(addr); sin = &so_mask.sin; sin->sin_addr.s_addr = htonl(mask); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188594 - head/sys/net
Author: thompsa Date: Fri Feb 13 19:20:25 2009 New Revision: 188594 URL: http://svn.freebsd.org/changeset/base/188594 Log: bridge_delete_member is called via the event handler from if_detach after the LLADDR is reclaimed which causes a null pointer deref with inherit_mac enabled. Record the ifnet pointer of the interface and then compare that to find when to re-assign the bridge address. Submitted by: sam Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c == --- head/sys/net/if_bridge.cFri Feb 13 19:16:15 2009(r188593) +++ head/sys/net/if_bridge.cFri Feb 13 19:20:25 2009(r188594) @@ -220,6 +220,7 @@ struct bridge_softc { LIST_HEAD(, bridge_iflist) sc_spanlist; /* span ports list */ struct bstp_state sc_stp; /* STP state */ uint32_tsc_brtexceeded; /* # of cache drops */ + struct ifnet*sc_ifaddr; /* member mac copied from */ u_char sc_defaddr[6]; /* Default MAC address */ }; @@ -930,15 +931,16 @@ bridge_delete_member(struct bridge_softc * the mac address of the bridge to the address of the next member, or * to its default address if no members are left. */ - if (bridge_inherit_mac && - !memcmp(IF_LLADDR(sc->sc_ifp), IF_LLADDR(ifs), ETHER_ADDR_LEN)) { - if (LIST_EMPTY(&sc->sc_iflist)) + if (bridge_inherit_mac && sc->sc_ifaddr == ifs) { + if (LIST_EMPTY(&sc->sc_iflist)) { bcopy(sc->sc_defaddr, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); - else { + sc->sc_ifaddr = NULL; + } else { fif = LIST_FIRST(&sc->sc_iflist)->bif_ifp; bcopy(IF_LLADDR(fif), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = fif; } } @@ -1039,8 +1041,10 @@ bridge_ioctl_add(struct bridge_softc *sc * the default randomly generated one. */ if (bridge_inherit_mac && LIST_EMPTY(&sc->sc_iflist) && - !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) + !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) { bcopy(IF_LLADDR(ifs), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = ifs; + } ifs->if_bridge = sc; bstp_create(&sc->sc_stp, &bif->bif_stp, bif->bif_ifp); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188596 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb geom/label
Author: lulf Date: Fri Feb 13 19:49:35 2009 New Revision: 188596 URL: http://svn.freebsd.org/changeset/base/188596 Log: MFC r188492: - Use the correct argument when determining the buffer size. PR: kern/131575 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/geom/label/g_label_msdosfs.c Modified: stable/7/sys/geom/label/g_label_msdosfs.c == --- stable/7/sys/geom/label/g_label_msdosfs.c Fri Feb 13 19:25:35 2009 (r188595) +++ stable/7/sys/geom/label/g_label_msdosfs.c Fri Feb 13 19:49:35 2009 (r188596) @@ -186,7 +186,7 @@ g_label_msdosfs_taste(struct g_consumer FAT_DES_ATTR_VOLUME_ID) { strlcpy(label, pfat_entry->DIR_Name, MIN(size, - sizeof(pfat_bsbpb->BS_VolLab) + 1)); + sizeof(pfat_entry->DIR_Name) + 1)); goto endofchecks; } } while((uint8_t *)(++pfat_entry) < ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188597 - head/sys/dev/usb
Author: n_hibma Date: Fri Feb 13 19:49:51 2009 New Revision: 188597 URL: http://svn.freebsd.org/changeset/base/188597 Log: Add support for CMOTECH devices (not sure whether this is the correct name) (not sure whether this works correctly, but should be close). Fix the stub attach phase for some Novatel cards. They expect the CSW (repsonse to CBW, SCSI eject command) to be fetched before switching to modem mode. MFC after:2 weeks Modified: head/sys/dev/usb/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/u3g.c == --- head/sys/dev/usb/u3g.c Fri Feb 13 19:49:35 2009(r188596) +++ head/sys/dev/usb/u3g.c Fri Feb 13 19:49:51 2009(r188597) @@ -87,25 +87,25 @@ struct ucom_callback u3g_callback = { struct u3g_speeds_s { - u_int32_t ispeed; // Speed in bits per second - u_int32_t ospeed; // Speed in bits per second + u_int32_t ispeed; + u_int32_t ospeed; }; static const struct u3g_speeds_s u3g_speeds[] = { -#define U3GSP_GPRS 0 - {64000, 64000}, -#define U3GSP_EDGE 1 - {384000, 64000}, -#define U3GSP_CDMA 2 - {384000, 64000}, -#define U3GSP_UMTS 3 - {384000, 64000}, -#define U3GSP_HSDPA4 - {120, 384000}, -#define U3GSP_HSUPA5 - {120, 384000}, -#define U3GSP_HSPA 6 - {720, 384000}, +#define U3GSP_GPRS 0 + {64000, 64000}, +#define U3GSP_EDGE 1 + {384000,64000}, +#define U3GSP_CDMA 2 + {384000,64000}, +#define U3GSP_UMTS 3 + {384000,64000}, +#define U3GSP_HSDPA4 + {120, 384000}, +#define U3GSP_HSUPA5 + {120, 384000}, +#define U3GSP_HSPA 6 + {720, 384000}, }; #define U3GIBUFSIZE1024 @@ -122,7 +122,8 @@ struct u3g_dev_type_s { #define U3GFL_HUAWEI_INIT 0x01// Requires init command (Huawei cards) #define U3GFL_SCSI_EJECT 0x02// Requires SCSI eject command (Novatel) #define U3GFL_SIERRA_INIT 0x04// Requires init command (Sierra cards) -#define U3GFL_STUB_WAIT0x08// Device reappears after a short delay +#define U3GFL_CMOTECH_INIT 0x08// Requires init command (CMOTECH cards) +#define U3GFL_STUB_WAIT0x80// Device reappears after a short delay }; // Note: The entries marked with XXX should be checked for the correct speed @@ -184,10 +185,13 @@ static const struct u3g_dev_type_s u3g_d {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8765 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875U }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_HSDPA,U3GFL_NONE }, // XXX - {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA,U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8780 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT },// Sierra TruInstaller device ID + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, + {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA,U3GFL_NONE }, + /* OEM: CMOTECH */ + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 }, U3GSP_HSDPA,U3GFL_CMOTECH_INIT }, + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_DISK }, U3GSP_HSDPA,U3GFL_NONE }, }; #define u3g_lookup(v, p) ((const struct u3g_dev_type_s *)usb_lookup(u3g_devs, v, p)) @@ -437,7 +441,7 @@ MODULE_VERSION(u3g, 1); struct u3gstub_softc { device_tsc_dev; usbd_device_handle sc_udev; - usbd_pipe_handlesc_pipe; + usbd_pipe_handlesc_pipe_out, sc_pipe_in; usbd_xfer_handlesc_xfer; }; @@ -457,6 +461,25 @@ u3gstub_huawei_init(struct u3gstub_softc return 1; } +static void +u3gstub_BBB_cb(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err) +{ + struct u3gstub_softc *sc = (struct u3gstub_softc *) priv; + unsigned char cmd[13]; + + if (err) { + device_printf(sc->sc_dev, + "Failed to send CD eject command to " + "change to modem mode\n"); + } else { + usbd_setup_xfer(sc->sc_xfe
svn commit: r188599 - head/share/man/man4
Author: n_hibma Date: Fri Feb 13 20:09:11 2009 New Revision: 188599 URL: http://svn.freebsd.org/changeset/base/188599 Log: Elaborate some on the workings of the stub. Collapse up the list of supported devices. Modified: head/share/man/man4/u3g.4 Modified: head/share/man/man4/u3g.4 == --- head/share/man/man4/u3g.4 Fri Feb 13 19:56:59 2009(r188598) +++ head/share/man/man4/u3g.4 Fri Feb 13 20:09:11 2009(r188599) @@ -56,50 +56,51 @@ driver supports the following adapters: .Pp .Bl -bullet -compact .It -Option Globetrotter 3G Fusion (only 3G part, not WLAN) +Option GT 3G Fusion, GT Fusion Quad, etc. (only 3G part, not WLAN) .It -Option Globetrotter 3G Fusion Quad (only 3G part, not WLAN) -.It -Option Globetrotter 3G Quad -.It -Option Globetrotter 3G +Option GT 3G, GT 3G Quad, etc. .It Vodafone Mobile Connect Card 3G .It Qualcomm Inc. CDMA MSM .It -Huawei E220 (E270?) +Huawei B190, E220 ('') .It -Huawei Mobile +Novatal U740, MC950D, X950D, etc. .It -Novatal MC950D -.It -Sierra cards +Sierra MC875U, MC8775U, etc. .El .Pp -See +(See .Pa /sys/dev/u3g.c for the complete list of supported cards for each vendor -mentioned above. +mentioned above.) .Pp -The supported 3G cards provide the necessary modem port for ppp, -pppd, or mpd connections as well as extra ports (depending on the specific -device) to provide other functions (diagnostic port, SIM toolkit port). +The supported 3G cards provide the necessary modem port for ppp, pppd, or mpd +connections as well as extra ports (depending on the specific device) to +provide other functions (additional command port, diagnostic port, SIM toolkit +port). .Pp In some of these devices a mass storage device supported by the .Xr umass 4 driver is present which contains Windows and Mac OS X drivers. -This device is -hidden, unless the machine was booted in verbose mode (see +The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires +additional commands to switch it to modem mode. +.Pp +The +.Xr u3gstub 4 +device will attach temporarily to a 3G device with a mass storage device and +force it to switch to modem mode, +The attach and detach of +.Xr u3gstub +and any driver disk device present on the 3G device is is hidden, unless the +machine was booted in verbose mode (see .Xr boot 8 ) . To temporarily unhide the device, set .Va debug.bootverbose to 1 using .Xr sysctl 8 and replug the device. -The -.Xr u3gstub 4 -device will attach temporarily and detach within seconds. .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r188570 - head/sys/cam
Attila Nagy wrote: Hello, Scott Long wrote: Author: scottl Date: Fri Feb 13 10:04:59 2009 New Revision: 188570 URL: http://svn.freebsd.org/changeset/base/188570 Log: In the case that the probe has determined that it can't query the device for a serial number, fall through to the next case so that initial negotiation still happens. Without this, devices were showing up with only 1 available tag opening, leading to observations of very poor I/O performance. This should fix problems reported with VMWare Fusion and ESX. Early generation MPT-SAS controllers with SATA disks might also be affected. HP CISS controllers are also likely affected, as are many other pseudo-scsi disk subsystems. Is it possible that these two are related? http://marc.info/?l=freebsd-scsi&m=122900270413265&w=2 This is a bug in Domain Validation, introduced a couple of years ago, that I still haven't sorted out. Scott ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188600 - head/sys/dev/usb2/core
Author: thompsa Date: Fri Feb 13 20:57:43 2009 New Revision: 188600 URL: http://svn.freebsd.org/changeset/base/188600 Log: MFp4 //depot/projects/usb; 157501, 157608, 157609 - Make usb2_transfer_pending() part of the USB core header file. - Make usb2_transfer_pending() NULL safe. - Make sure that USB process functions return if the process has been drained. - Remove two unused functions. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb2/core/usb2_process.c head/sys/dev/usb2/core/usb2_process.h head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_transfer.h Modified: head/sys/dev/usb2/core/usb2_core.h == --- head/sys/dev/usb2/core/usb2_core.h Fri Feb 13 20:09:11 2009 (r188599) +++ head/sys/dev/usb2/core/usb2_core.h Fri Feb 13 20:57:43 2009 (r188600) @@ -449,6 +449,7 @@ voidusb2_start_hardware(struct usb2_xfe void usb2_transfer_clear_stall(struct usb2_xfer *xfer); void usb2_transfer_drain(struct usb2_xfer *xfer); void usb2_transfer_set_stall(struct usb2_xfer *xfer); +uint8_tusb2_transfer_pending(struct usb2_xfer *xfer); void usb2_transfer_start(struct usb2_xfer *xfer); void usb2_transfer_stop(struct usb2_xfer *xfer); void usb2_transfer_unsetup(struct usb2_xfer **pxfer, uint16_t n_setup); Modified: head/sys/dev/usb2/core/usb2_process.c == --- head/sys/dev/usb2/core/usb2_process.c Fri Feb 13 20:09:11 2009 (r188599) +++ head/sys/dev/usb2/core/usb2_process.c Fri Feb 13 20:57:43 2009 (r188600) @@ -84,9 +84,9 @@ usb2_process(void *arg) while (1) { - if (up->up_gone) { + if (up->up_gone) break; - } + /* * NOTE to reimplementors: dequeueing a command from the * "used" queue and executing it must be atomic, with regard @@ -213,10 +213,10 @@ error: void usb2_proc_free(struct usb2_process *up) { - if (!(up->up_mtx)) { - /* not initialised */ + /* check if not initialised */ + if (up->up_mtx == NULL) return; - } + usb2_proc_drain(up); usb2_cv_destroy(&up->up_cv); @@ -246,6 +246,10 @@ usb2_proc_msignal(struct usb2_process *u uint32_t d; uint8_t t; + /* check if gone, return dummy value */ + if (up->up_gone) + return (_pm0); + mtx_assert(up->up_mtx, MA_OWNED); t = 0; @@ -319,9 +323,11 @@ usb2_proc_msignal(struct usb2_process *u uint8_t usb2_proc_is_gone(struct usb2_process *up) { - mtx_assert(up->up_mtx, MA_OWNED); + if (up->up_gone) + return (1); - return (up->up_gone ? 1 : 0); + mtx_assert(up->up_mtx, MA_OWNED); + return (0); } /** @@ -337,6 +343,10 @@ usb2_proc_mwait(struct usb2_process *up, struct usb2_proc_msg *pm0 = _pm0; struct usb2_proc_msg *pm1 = _pm1; + /* check if gone */ + if (up->up_gone) + return; + mtx_assert(up->up_mtx, MA_OWNED); if (up->up_curtd == curthread) { @@ -372,13 +382,13 @@ usb2_proc_mwait(struct usb2_process *up, void usb2_proc_drain(struct usb2_process *up) { - if (!(up->up_mtx)) { - /* not initialised */ + /* check if not initialised */ + if (up->up_mtx == NULL) return; - } - if (up->up_mtx != &Giant) { + /* handle special case with Giant */ + if (up->up_mtx != &Giant) mtx_assert(up->up_mtx, MA_NOTOWNED); - } + mtx_lock(up->up_mtx); /* Set the gone flag */ @@ -398,7 +408,8 @@ usb2_proc_drain(struct usb2_process *up) if (cold) { USB_THREAD_SUSPEND(up->up_ptr); - printf("WARNING: A USB process has been left suspended!\n"); + printf("WARNING: A USB process has " + "been left suspended!\n"); break; } usb2_cv_wait(&up->up_cv, up->up_mtx); @@ -413,64 +424,3 @@ usb2_proc_drain(struct usb2_process *up) } mtx_unlock(up->up_mtx); } - -/** - * usb2_proc_cwait - * - * This function will suspend the current process until - * "usb2_proc_signal()" or "usb2_proc_drain()" is called. The - * "timeout" parameter defines the maximum wait time in system - * ticks. If "timeout" is zero that means no timeout. - * - * NOTE: This function can only be called from within an USB process. - * - * Return values: - * USB_PROC_WAIT_TIMEOUT: Timeout - * USB_PROC_WAIT_NORMAL: Success
svn commit: r188601 - head/sys/dev/usb2/wlan
Author: thompsa Date: Fri Feb 13 21:45:19 2009 New Revision: 188601 URL: http://svn.freebsd.org/changeset/base/188601 Log: - ieee80211_chan2ieee returns an int - set ic_update_promisc to the same callback as mcast - avoid null deref in zyd_detach Obtained from://depot/projects/usb Modified: head/sys/dev/usb2/wlan/if_zyd2.c Modified: head/sys/dev/usb2/wlan/if_zyd2.c == --- head/sys/dev/usb2/wlan/if_zyd2.cFri Feb 13 20:57:43 2009 (r188600) +++ head/sys/dev/usb2/wlan/if_zyd2.cFri Feb 13 21:45:19 2009 (r188601) @@ -104,7 +104,7 @@ static struct ieee80211_node *zyd_node_a const uint8_t mac[IEEE80211_ADDR_LEN]); static int zyd_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int zyd_cmd(struct zyd_softc *, uint16_t, const void *, int, - void *, int, u_int); + void *, int, int); static int zyd_read16(struct zyd_softc *, uint16_t, uint16_t *); static int zyd_read32(struct zyd_softc *, uint16_t, uint32_t *); static int zyd_write16(struct zyd_softc *, uint16_t, uint16_t); @@ -419,6 +419,7 @@ zyd_attach_post(struct usb2_proc_msg *pm ic->ic_vap_create = zyd_vap_create; ic->ic_vap_delete = zyd_vap_delete; ic->ic_update_mcast = zyd_update_mcast; + ic->ic_update_promisc = zyd_update_mcast; bpfattach(ifp, DLT_IEEE802_11_RADIO, sizeof(struct ieee80211_frame) + sizeof(sc->sc_txtap)); @@ -440,7 +441,7 @@ zyd_detach(device_t dev) { struct zyd_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -453,6 +454,7 @@ zyd_detach(device_t dev) zyd_unsetup_tx_list(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); @@ -810,7 +812,7 @@ tr_setup: static int zyd_cmd(struct zyd_softc *sc, uint16_t code, const void *idata, int ilen, -void *odata, int olen, u_int flags) +void *odata, int olen, int flags) { struct zyd_cmd cmd; struct zyd_rq rq; @@ -1260,7 +1262,7 @@ zyd_al2230_bandedge6(struct zyd_rf *rf, struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct zyd_phy_pair r[] = ZYD_AL2230_PHY_BANDEDGE6; - u_int chan = ieee80211_chan2ieee(ic, c); + int chan = ieee80211_chan2ieee(ic, c); if (chan == 1 || chan == 11) r[0].val = 0x12; @@ -2085,7 +2087,7 @@ zyd_set_chan(struct zyd_softc *sc, struc struct ieee80211com *ic = ifp->if_l2com; struct zyd_rf *rf = &sc->sc_rf; uint32_t tmp; - u_int chan; + int chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188602 - head/usr.sbin/inetd
Author: delphij Date: Fri Feb 13 22:48:05 2009 New Revision: 188602 URL: http://svn.freebsd.org/changeset/base/188602 Log: Sync comment with actual configuration format. Modified: head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/inetd.c == --- head/usr.sbin/inetd/inetd.c Fri Feb 13 21:45:19 2009(r188601) +++ head/usr.sbin/inetd/inetd.c Fri Feb 13 22:48:05 2009(r188602) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); * socket type stream/dgram/raw/rdm/seqpacket * protocoltcp[4][6][/faith], udp[4][6], unix * wait/nowait single-threaded/multi-threaded - * useruser to run daemon as + * user[:group][/login-class] user/group/login-class to run daemon as * server program full path name * server program argumentsmaximum of MAXARGS (20) * @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); * socket type stream/dgram/raw/rdm/seqpacket * protocolrpc/tcp[4][6], rpc/udp[4][6] * wait/nowait single-threaded/multi-threaded - * useruser to run daemon as + * user[:group][/login-class] user/group/login-class to run daemon as * server program full path name * server program argumentsmaximum of MAXARGS * ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r188587 - stable/7/sys/netinet
On Fri, Feb 13, 2009 at 06:54:37PM +, Robert Watson wrote: > > On Fri, 13 Feb 2009, Luigi Rizzo wrote: > > >Author: luigi > >Date: Fri Feb 13 18:09:38 2009 > >New Revision: 188587 > >URL: http://svn.freebsd.org/changeset/base/188587 > > > >Log: > > MFC - replace usage of n_* types with uint*_t , to help removing > > unnecessary dependencies on in_systm.h > > As harmless as these changes may seem, insta-MFCs often come with > unexpected side effects. A three day MFC wait will also never hurt for > what are definitely not critical bug fixes :-). To put this commit in the right context: I know the recommendation on MFC. But this is actually not an MFC but an MFStable as I will explain below. I started this work to remove useless header dependencies from ipfw and dummynet (and, as a side effect, the network stack as well). You may have seen userland changes being committed 1-2 weeks ago, in that case only in HEAD because that's was the appropriate approach in that context. But the kernel side is different. As I mentioned in some other commits today, HEAD and RELENG_7 are largely different in this respect after the VIMAGE import: in HEAD, several netinet/ files #include vnet.h and vinet.h which in turn bring in almost everything related to networking: if.h, route.h, <*_var.h> for the stats records, locks and so on. As a result, the cleanup work needs to be done differently in the two branches. In fact, the real reference is RELENG_7 which is clean from nested #include's: it's there that I can find out which headers are not necessary, and then I use the information to drive the changes to HEAD keeping in mind that eventually vinet.h should be cleaned up as well. That's why I say that these changes are closer to Merge >From Stable than to MFC. The n_* cleanup just happens to be part of both changesets, but that's only a minor part. cheers luigi ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188603 - head/sys/dev/kbdmux
Author: thompsa Date: Fri Feb 13 23:36:08 2009 New Revision: 188603 URL: http://svn.freebsd.org/changeset/base/188603 Log: Since r188030 the error value for attach is returned, this means if kbdmux fails to attach (possibly due to disable hints) then we get called back for unload. Correctly handle the case where the keyboard isnt found rather than calling panic. Modified: head/sys/dev/kbdmux/kbdmux.c Modified: head/sys/dev/kbdmux/kbdmux.c == --- head/sys/dev/kbdmux/kbdmux.cFri Feb 13 22:48:05 2009 (r188602) +++ head/sys/dev/kbdmux/kbdmux.cFri Feb 13 23:36:08 2009 (r188603) @@ -1346,15 +1346,14 @@ kbdmux_modevent(module_t mod, int type, panic("kbd_get_switch(" KEYBOARD_NAME ") == NULL"); kbd = kbd_get_keyboard(kbd_find_keyboard(KEYBOARD_NAME, 0)); - if (kbd == NULL) -panic("kbd_get_keyboard(kbd_find_keyboard(" KEYBOARD_NAME ", 0)) == NULL"); - - (*sw->disable)(kbd); + if (kbd != NULL) { + (*sw->disable)(kbd); #ifdef KBD_INSTALL_CDEV - kbd_detach(kbd); + kbd_detach(kbd); #endif - (*sw->term)(kbd); - kbd_delete_driver(&kbdmux_kbd_driver); + (*sw->term)(kbd); + kbd_delete_driver(&kbdmux_kbd_driver); + } error = 0; break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r188603 - head/sys/dev/kbdmux
On Fri, Feb 13, 2009 at 3:36 PM, Andrew Thompson wrote: > Author: thompsa > Date: Fri Feb 13 23:36:08 2009 > New Revision: 188603 > URL: http://svn.freebsd.org/changeset/base/188603 > > Log: > Since r188030 the error value for attach is returned, this means if kbdmux > fails to attach (possibly due to disable hints) then we get called back for > unload. Correctly handle the case where the keyboard isnt found rather than > calling panic. thanks for taking care of this! thanks, max > > Modified: > head/sys/dev/kbdmux/kbdmux.c > > Modified: head/sys/dev/kbdmux/kbdmux.c > == > --- head/sys/dev/kbdmux/kbdmux.cFri Feb 13 22:48:05 2009 > (r188602) > +++ head/sys/dev/kbdmux/kbdmux.cFri Feb 13 23:36:08 2009 > (r188603) > @@ -1346,15 +1346,14 @@ kbdmux_modevent(module_t mod, int type, >panic("kbd_get_switch(" KEYBOARD_NAME ") == NULL"); > >kbd = kbd_get_keyboard(kbd_find_keyboard(KEYBOARD_NAME, 0)); > - if (kbd == NULL) > -panic("kbd_get_keyboard(kbd_find_keyboard(" > KEYBOARD_NAME ", 0)) == NULL"); > - > - (*sw->disable)(kbd); > + if (kbd != NULL) { > + (*sw->disable)(kbd); > #ifdef KBD_INSTALL_CDEV > - kbd_detach(kbd); > + kbd_detach(kbd); > #endif > - (*sw->term)(kbd); > - kbd_delete_driver(&kbdmux_kbd_driver); > + (*sw->term)(kbd); > + kbd_delete_driver(&kbdmux_kbd_driver); > + } >error = 0; >break; > > ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"