svn commit: r188846 - in head/sys/dev/ata: . chipsets
Author: mav Date: Fri Feb 20 08:49:56 2009 New Revision: 188846 URL: http://svn.freebsd.org/changeset/base/188846 Log: Handle nForce MCP67 and MCP73 SATA controllers as AHCI. They report itself as ATA RAID, but generic ATAPCI driver unable to detect drives there. AHCI driver reported to handle them fine. Linux does the same. Submitted by: Andrey V. Elsukov on stable@ Modified: head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-nvidia.c Modified: head/sys/dev/ata/ata-pci.h == --- head/sys/dev/ata/ata-pci.h Fri Feb 20 07:43:43 2009(r188845) +++ head/sys/dev/ata/ata-pci.h Fri Feb 20 08:49:56 2009(r188846) @@ -258,8 +258,32 @@ struct ata_connect_task { #define ATA_NFORCE_MCP61_S2 0x03f610de #define ATA_NFORCE_MCP61_S3 0x03f710de #define ATA_NFORCE_MCP650x044810de +#define ATA_NFORCE_MCP67_A0 0x055010de +#define ATA_NFORCE_MCP67_A1 0x055110de +#define ATA_NFORCE_MCP67_A2 0x055210de +#define ATA_NFORCE_MCP67_A3 0x055310de +#define ATA_NFORCE_MCP67_A4 0x055410de +#define ATA_NFORCE_MCP67_A5 0x055510de +#define ATA_NFORCE_MCP67_A6 0x055610de +#define ATA_NFORCE_MCP67_A7 0x055710de +#define ATA_NFORCE_MCP67_A8 0x055810de +#define ATA_NFORCE_MCP67_A9 0x055910de +#define ATA_NFORCE_MCP67_AA 0x055A10de +#define ATA_NFORCE_MCP67_AB 0x055B10de #define ATA_NFORCE_MCP670x056010de #define ATA_NFORCE_MCP730x056c10de +#define ATA_NFORCE_MCP73_A0 0x07f010de +#define ATA_NFORCE_MCP73_A1 0x07f110de +#define ATA_NFORCE_MCP73_A2 0x07f210de +#define ATA_NFORCE_MCP73_A3 0x07f310de +#define ATA_NFORCE_MCP73_A4 0x07f410de +#define ATA_NFORCE_MCP73_A5 0x07f510de +#define ATA_NFORCE_MCP73_A6 0x07f610de +#define ATA_NFORCE_MCP73_A7 0x07f710de +#define ATA_NFORCE_MCP73_A8 0x07f810de +#define ATA_NFORCE_MCP73_A9 0x07f910de +#define ATA_NFORCE_MCP73_AA 0x07fa10de +#define ATA_NFORCE_MCP73_AB 0x07fb10de #define ATA_NFORCE_MCP770x075910de #define ATA_PROMISE_ID 0x105a Modified: head/sys/dev/ata/chipsets/ata-nvidia.c == --- head/sys/dev/ata/chipsets/ata-nvidia.c Fri Feb 20 07:43:43 2009 (r188845) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Fri Feb 20 08:49:56 2009 (r188846) @@ -61,6 +61,7 @@ static void ata_nvidia_setmode(device_t /* misc defines */ #define NV4 0x01 #define NVQ 0x02 +#define NVAHCI 0x04 /* @@ -97,7 +98,31 @@ ata_nvidia_probe(device_t dev) { ATA_NFORCE_MCP61_S3, 0, NV4|NVQ, 0, ATA_SA300, "nForce MCP61" }, { ATA_NFORCE_MCP65,0, 0, 0, ATA_UDMA6, "nForce MCP65" }, { ATA_NFORCE_MCP67,0, 0, 0, ATA_UDMA6, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A2, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A3, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A4, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A5, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A6, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A7, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A8, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A9, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, { ATA_NFORCE_MCP73,0, 0, 0, ATA_UDMA6, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A2, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A3, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A4, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A5, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A6, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A7, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A8, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A9, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, { ATA_NFORCE_MCP77,0, 0, 0, ATA_UDMA6, "nForce MCP77" }, { 0, 0, 0, 0, 0, 0}} ; @@ -108,7 +133,10 @@ ata_nvidia_probe(device_t dev) return ENXIO; ata_set_desc(dev); -ctlr->chipinit = ata_nvidia_chipinit; +if (ctlr->chip->cfg1 & NVAHC
svn commit: r188847 - svnadmin/conf
Author: rpaulo Date: Fri Feb 20 11:03:12 2009 New Revision: 188847 URL: http://svn.freebsd.org/changeset/base/188847 Log: Add Andriy Gapon. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors == --- svnadmin/conf/mentors Fri Feb 20 08:49:56 2009(r188846) +++ svnadmin/conf/mentors Fri Feb 20 11:03:12 2009(r188847) @@ -10,6 +10,7 @@ # Sort by mentee login name. # Mentee Mentor Optional comment +avgrpaulo Co-mentor: jhb erimlaier Co-mentor: thompsa jamie bz Co-mentor: brooks phokib ___ 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: r188848 - head/tools/build/options
Author: mtm Date: Fri Feb 20 11:09:55 2009 New Revision: 188848 URL: http://svn.freebsd.org/changeset/base/188848 Log: Doh! r188813 modified an auto-generated file. Fix it for real: o grammar fix o remove mention of libkse Submitted by: Niclas Zeising Modified: head/tools/build/options/WITHOUT_LIBPTHREAD head/tools/build/options/makeman Modified: head/tools/build/options/WITHOUT_LIBPTHREAD == --- head/tools/build/options/WITHOUT_LIBPTHREAD Fri Feb 20 11:03:12 2009 (r188847) +++ head/tools/build/options/WITHOUT_LIBPTHREAD Fri Feb 20 11:09:55 2009 (r188848) @@ -1,8 +1,5 @@ .\" $FreeBSD$ -Set to not build either of the +Set to not build the .Nm libpthread -providing libraries -.Nm ( libthr -(1:1) & -.Nm libkse -(M:N)). +providing library, +.Nm libthr . Modified: head/tools/build/options/makeman == --- head/tools/build/options/makemanFri Feb 20 11:03:12 2009 (r188847) +++ head/tools/build/options/makemanFri Feb 20 11:09:55 2009 (r188848) @@ -118,7 +118,7 @@ for a particular build via the .Fl D option of .Xr make 1 -or in environment; see +or in its environment; see .Xr environ 7 . .Pp The values of variables are ignored regardless of their setting; ___ 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: r188849 - in head/sys: compat/linux kern sys
Author: ed Date: Fri Feb 20 13:05:29 2009 New Revision: 188849 URL: http://svn.freebsd.org/changeset/base/188849 Log: Don't make Linux stat() open character devices to resolve its name. The existing code calls kern_open() to resolve the vnode of a pathname right after a stat(). This is not correct, because it causes random character devices to be opened in /dev. This means ls'ing a tape streamer will cause it to rewind, for example. Changes I have made: - Add kern_statat_vnhook() to allow binary emulators to `post-process' struct stat, using the proper vnode. - Remove unneeded printf's from stat() and statfs(). - Make the Linuxolator use kern_statat_vnhook(), replacing translate_path_major_minor_at(). - Let translate_fd_major_minor() use vp->v_rdev instead of vp->v_un.vu_cdev. Result: crw-rw-rw- 1 root root 0, 14 Feb 20 13:54 /dev/ptmx crw--w 1 root adm 136, 0 Feb 20 14:03 /dev/pts/0 crw--w 1 root adm 136, 1 Feb 20 14:02 /dev/pts/1 crw--w 1 ed tty 136, 2 Feb 20 14:03 /dev/pts/2 Before this commit, ptmx also had a major number of 136, because it silently allocated and deallocated a pseudo-terminal. Device nodes that cannot be opened now have proper major/minor-numbers. Reviewed by: kib, netchild, rdivacky (thanks!) Modified: head/sys/compat/linux/linux_stats.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/linux/linux_stats.c == --- head/sys/compat/linux/linux_stats.c Fri Feb 20 11:09:55 2009 (r188848) +++ head/sys/compat/linux/linux_stats.c Fri Feb 20 13:05:29 2009 (r188849) @@ -62,6 +62,44 @@ __FBSDID("$FreeBSD$"); #include +static void +translate_vnhook_major_minor(struct vnode *vp, struct stat *sb) +{ + int major, minor; + + if (vp->v_type == VCHR && vp->v_rdev != NULL && + linux_driver_get_major_minor(vp->v_rdev->si_name, + &major, &minor) == 0) { + sb->st_rdev = (major << 8 | minor); + } +} + +static int +linux_kern_statat(struct thread *td, int flag, int fd, char *path, +enum uio_seg pathseg, struct stat *sbp) +{ + + return (kern_statat_vnhook(td, flag, fd, path, pathseg, sbp, + translate_vnhook_major_minor)); +} + +static int +linux_kern_stat(struct thread *td, char *path, enum uio_seg pathseg, +struct stat *sbp) +{ + + return (linux_kern_statat(td, 0, AT_FDCWD, path, pathseg, sbp)); +} + +static int +linux_kern_lstat(struct thread *td, char *path, enum uio_seg pathseg, +struct stat *sbp) +{ + + return (linux_kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path, + pathseg, sbp)); +} + /* * XXX: This was removed from newstat_copyout(), and almost identical * XXX: code was in stat64_copyout(). findcdev() needs to be replaced @@ -102,14 +140,15 @@ static void translate_fd_major_minor(struct thread *td, int fd, struct stat *buf) { struct file *fp; + struct vnode *vp; int major, minor; if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || fget(td, fd, &fp) != 0) return; - if (fp->f_vnode != NULL && - fp->f_vnode->v_un.vu_cdev != NULL && - linux_driver_get_major_minor(fp->f_vnode->v_un.vu_cdev->si_name, + vp = fp->f_vnode; + if (vp != NULL && vp->v_rdev != NULL && + linux_driver_get_major_minor(vp->v_rdev->si_name, &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } else if (fp->f_type == DTYPE_PTS) { @@ -124,32 +163,6 @@ translate_fd_major_minor(struct thread * fdrop(fp, td); } -static void -translate_path_major_minor_at(struct thread *td, char *path, -struct stat *buf, int dfd) -{ - struct proc *p = td->td_proc; - struct filedesc *fdp = p->p_fd; - int fd; - int temp; - - if (!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) - return; - temp = td->td_retval[0]; - if (kern_openat(td, dfd, path, UIO_SYSSPACE, O_RDONLY, 0) != 0) - return; - fd = td->td_retval[0]; - td->td_retval[0] = temp; - translate_fd_major_minor(td, fd, buf); - fdclose(fdp, fdp->fd_ofiles[fd], fd, td); -} - -static inline void -translate_path_major_minor(struct thread *td, char *path, struct stat *buf) -{ - translate_path_major_minor_at(td, path, buf, AT_FDCWD); -} - static int newstat_copyout(struct stat *buf, void *ubuf) { @@ -187,9 +200,7 @@ linux_newstat(struct thread *td, struct printf(ARGS(newstat, "%s, *"), path); #endif - error = kern_stat(td, path, UIO_SYSSPACE, &buf); - if (!error) - translate_path_major_minor(td, path, &buf); + error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf); LFREEPATH(path);
svn commit: r188850 - head/sys/dev/ata
Author: mav Date: Fri Feb 20 14:10:23 2009 New Revision: 188850 URL: http://svn.freebsd.org/changeset/base/188850 Log: Fix pc98 build error due to missing variable. Submitted by: avg Modified: head/sys/dev/ata/ata-cbus.c Modified: head/sys/dev/ata/ata-cbus.c == --- head/sys/dev/ata/ata-cbus.c Fri Feb 20 13:05:29 2009(r188849) +++ head/sys/dev/ata/ata-cbus.c Fri Feb 20 14:10:23 2009(r188850) @@ -304,6 +304,7 @@ ata_cbuschannel_attach(device_t dev) static int ata_cbuschannel_detach(device_t dev) { +struct ata_channel *ch = device_get_softc(dev); if (!ch->attached) return (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: r188851 - head/release/picobsd/build
Author: luigi Date: Fri Feb 20 14:28:56 2009 New Revision: 188851 URL: http://svn.freebsd.org/changeset/base/188851 Log: when initializing, also build _includes and _libraries On passing, fix a wrong comment MFC after:3 days Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd == --- head/release/picobsd/build/picobsd Fri Feb 20 14:10:23 2009 (r188850) +++ head/release/picobsd/build/picobsd Fri Feb 20 14:28:56 2009 (r188851) @@ -150,7 +150,7 @@ set_defaults() { trap fail 15 } -# entry for 4.x and earlier trees +# use the new build infrastructure create_includes_and_libraries2() { local no log "create_includes_and_libraries2() for ${SRC}" @@ -163,7 +163,7 @@ create_includes_and_libraries2() { export MAKEOBJDIRPREFIX ( cd ${SRC}; # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld -make _+_= $no toolchain +make _+_= $no toolchain _includes _libraries ) } ___ 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: r188852 - head/sys/netinet
Author: rrs Date: Fri Feb 20 14:33:45 2009 New Revision: 188852 URL: http://svn.freebsd.org/changeset/base/188852 Log: Fix a bug. The sending was being restricted improperly by the max_burst. It should only be gated by cwnd in the lower level send. Obtained from:Michael Tuexen MFC after:1 week. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Fri Feb 20 14:28:56 2009 (r188851) +++ head/sys/netinet/sctp_output.c Fri Feb 20 14:33:45 2009 (r188852) @@ -15014,7 +15014,7 @@ skip_preblock: } else { un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); - if (net->flight_size > (net->mtu * stcb->asoc.max_burst)) { + if (net->flight_size > net->cwnd) { queue_only = 1; SCTP_STAT_INCR(sctps_send_burst_avoid); } else if (net->flight_size > net->cwnd) { @@ -15291,7 +15291,7 @@ skip_out_eof: } else { un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); - if (net->flight_size > (net->mtu * stcb->asoc.max_burst)) { + if (net->flight_size > net->cwnd) { queue_only = 1; SCTP_STAT_INCR(sctps_send_burst_avoid); } else if (net->flight_size > net->cwnd) { ___ 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: r188853 - head/tools/tools/nanobsd/rescue/Files/root
Author: mr Date: Fri Feb 20 14:53:49 2009 New Revision: 188853 URL: http://svn.freebsd.org/changeset/base/188853 Log: Delete files which serve no purpose in this environment. Inspired by: simon@ Deleted: head/tools/tools/nanobsd/rescue/Files/root/change_password head/tools/tools/nanobsd/rescue/Files/root/save_cfg head/tools/tools/nanobsd/rescue/Files/root/save_sshkeys head/tools/tools/nanobsd/rescue/Files/root/updatep1 head/tools/tools/nanobsd/rescue/Files/root/updatep2 ___ 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: r188854 - head/sys/netinet
Author: rrs Date: Fri Feb 20 15:03:54 2009 New Revision: 188854 URL: http://svn.freebsd.org/changeset/base/188854 Log: Add the add-stream capability. Still needs more testing.. MFC after:1 month Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_constants.h == --- head/sys/netinet/sctp_constants.h Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_constants.h Fri Feb 20 15:03:54 2009 (r188854) @@ -418,11 +418,12 @@ __FBSDID("$FreeBSD$"); #define SCTP_HOSTNAME_ADDRESS 0x000b #define SCTP_SUPPORTED_ADDRTYPE0x000c -/* draft-ietf-stewart-strreset-xxx */ +/* draft-ietf-stewart-tsvwg-strreset-xxx */ #define SCTP_STR_RESET_OUT_REQUEST 0x000d #define SCTP_STR_RESET_IN_REQUEST 0x000e #define SCTP_STR_RESET_TSN_REQUEST 0x000f #define SCTP_STR_RESET_RESPONSE0x0010 +#define SCTP_STR_RESET_ADD_STREAMS 0x0011 #define SCTP_MAX_RESET_PARAMS 2 #define SCTP_STREAM_RESET_TSN_DELTA0x1000 @@ -794,7 +795,11 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_SPECIAL_SP_FAIL 27 #define SCTP_NOTIFY_NO_PEER_AUTH28 #define SCTP_NOTIFY_SENDER_DRY 29 -#define SCTP_NOTIFY_MAX 29 +#define SCTP_NOTIFY_STR_RESET_ADD_OK30 +#define SCTP_NOTIFY_STR_RESET_ADD_FAIL 31 +#define SCTP_NOTIFY_STR_RESET_INSTREAM_ADD_OK 32 +#define SCTP_NOTIFY_MAX 32 + /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: head/sys/netinet/sctp_header.h == --- head/sys/netinet/sctp_header.h Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_header.h Fri Feb 20 15:03:54 2009 (r188854) @@ -498,7 +498,12 @@ struct sctp_stream_reset_response_tsn { uint32_t receivers_next_tsn; } SCTP_PACKED; - +struct sctp_stream_reset_add_strm { + struct sctp_paramhdr ph; + uint32_t request_seq; + uint16_t number_of_streams; + uint16_t reserved; +}; #define SCTP_STREAM_RESET_NOTHING 0x /* Nothing for me to do */ #define SCTP_STREAM_RESET_PERFORMED 0x0001 /* Did it */ Modified: head/sys/netinet/sctp_input.c == --- head/sys/netinet/sctp_input.c Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_input.c Fri Feb 20 15:03:54 2009 (r188854) @@ -314,7 +314,7 @@ sctp_process_init(struct sctp_init_chunk asoc->pre_open_streams = newcnt; } SCTP_TCB_SEND_UNLOCK(stcb); - asoc->streamoutcnt = asoc->pre_open_streams; + asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams; /* init tsn's */ asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1; /* EY - nr_sack: initialize highest tsn in nr_mapping_array */ @@ -3440,6 +3440,17 @@ sctp_handle_stream_reset_response(struct if (action != SCTP_STREAM_RESET_PERFORMED) { sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_FAILED_IN, stcb, number_entries, srparam->list_of_streams, SCTP_SO_NOT_LOCKED); } + } else if (type == SCTP_STR_RESET_ADD_STREAMS) { + /* Ok we now may have more streams */ + if (action == SCTP_STREAM_RESET_PERFORMED) { + /* Put the new streams into effect */ + stcb->asoc.streamoutcnt = stcb->asoc.strm_realoutsize; + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD_OK, stcb, + (uint32_t) stcb->asoc.streamoutcnt, NULL, SCTP_SO_NOT_LOCKED); + } else { + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD_FAIL, stcb, + (uint32_t) stcb->asoc.streamoutcnt, NULL, SCTP_SO_NOT_LOCKED); + } } else if (type == SCTP_STR_RESET_TSN_REQUEST) { /** * a) Adopt the new in tsn. @@ -3709,6 +3720,63 @@ sctp_handle_str_reset_request_out(struct } } +static void +sctp_handle_str_reset_add_strm(struct sctp_tcb *stcb, struc
svn commit: r188857 - svnadmin/conf
Author: sam Date: Fri Feb 20 15:52:53 2009 New Revision: 188857 URL: http://svn.freebsd.org/changeset/base/188857 Log: add Chris Zimmermman Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors == --- svnadmin/conf/mentors Fri Feb 20 15:26:34 2009(r188856) +++ svnadmin/conf/mentors Fri Feb 20 15:52:53 2009(r188857) @@ -11,6 +11,7 @@ # Mentee Mentor Optional comment avgrpaulo Co-mentor: jhb +cbzimmer sam erimlaier Co-mentor: thompsa jamie bz Co-mentor: brooks phokib ___ 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: r188859 - head/sys/vm
Author: alc Date: Fri Feb 20 16:19:34 2009 New Revision: 188859 URL: http://svn.freebsd.org/changeset/base/188859 Log: Eliminate stale comments. Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c == --- head/sys/vm/swap_pager.cFri Feb 20 16:11:43 2009(r188858) +++ head/sys/vm/swap_pager.cFri Feb 20 16:19:34 2009(r188859) @@ -1318,10 +1318,6 @@ swap_pager_putpages(vm_object_t object, * because we marked them all VM_PAGER_PEND on return from putpages ). * * This routine may not block. - * This routine is called at splbio() or better - * - * We up ourselves to splvm() as required for various vm_page related - * calls. */ static void swp_pager_async_iodone(struct buf *bp) ___ 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: r188860 - in head/sys/powerpc: aim include powerpc
Author: nwhitehorn Date: Fri Feb 20 17:48:40 2009 New Revision: 188860 URL: http://svn.freebsd.org/changeset/base/188860 Log: Add Altivec support for supported CPUs. This is derived from the FPU support code, and also reducing the size of trapcode to fit inside a 32 byte handler slot. Reviewed by: grehan MFC after:2 weeks Added: head/sys/powerpc/include/altivec.h (contents, props changed) head/sys/powerpc/powerpc/altivec.c (contents, props changed) Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/swtch.S head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr.S head/sys/powerpc/include/pcb.h head/sys/powerpc/include/pcpu.h head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/aim/machdep.c == --- head/sys/powerpc/aim/machdep.c Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/aim/machdep.c Fri Feb 20 17:48:40 2009 (r188860) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -238,7 +239,6 @@ extern void *dsitrap, *dsisize; extern void*decrint, *decrsize; extern void *extint, *extsize; extern void*dblow, *dbsize; -extern void*vectrap, *vectrapsize; u_int powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp) @@ -340,7 +340,7 @@ powerpc_init(u_int startkernel, u_int en bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_TRC, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_FPA, (size_t)&trapsize); - bcopy(&vectrap, (void *)EXC_VEC, (size_t)&vectrapsize); + bcopy(&trapcode, (void *)EXC_VEC, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_VECAST, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_THRM, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_BPT, (size_t)&trapsize); @@ -647,7 +647,21 @@ grab_mcontext(struct thread *td, mcontex memcpy(mcp->mc_fpreg, pcb->pcb_fpu.fpr, 32*sizeof(double)); } - /* XXX Altivec context ? */ + /* +* Repeat for Altivec context +*/ + + if (pcb->pcb_flags & PCB_VEC) { + KASSERT(td == curthread, + ("get_mcontext: fp save not curthread")); + critical_enter(); + save_vec(td); + critical_exit(); + mcp->mc_flags |= _MC_AV_VALID; + mcp->mc_vscr = pcb->pcb_vec.vscr; + mcp->mc_vrsave = pcb->pcb_vec.vrsave; + memcpy(mcp->mc_avec, pcb->pcb_vec.vr, sizeof(mcp->mc_avec)); + } mcp->mc_len = sizeof(*mcp); @@ -701,7 +715,17 @@ set_mcontext(struct thread *td, const mc memcpy(pcb->pcb_fpu.fpr, mcp->mc_fpreg, 32*sizeof(double)); } - /* XXX Altivec context? */ + if (mcp->mc_flags & _MC_AV_VALID) { + if ((pcb->pcb_flags & PCB_VEC) != PCB_VEC) { + critical_enter(); + enable_vec(td); + critical_exit(); + } + pcb->pcb_vec.vscr = mcp->mc_vscr; + pcb->pcb_vec.vrsave = mcp->mc_vrsave; + memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec)); + } + return (0); } Modified: head/sys/powerpc/aim/swtch.S == --- head/sys/powerpc/aim/swtch.SFri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/aim/swtch.SFri Feb 20 17:48:40 2009 (r188860) @@ -106,8 +106,16 @@ ENTRY(cpu_switch) andi. %r6, %r6, PCB_FPU beq .L1 bl save_fpu - mr %r3,%r14/* restore old thread ptr */ + .L1: + lwz %r6,PCB_FLAGS(%r5) + /* Save Altivec context if needed */ + andi. %r6, %r6, PCB_VEC + beq .L2 + bl save_vec + +.L2: + mr %r3,%r14/* restore old thread ptr */ bl pmap_deactivate /* Deactivate the current pmap */ cpu_switchin: @@ -122,12 +130,20 @@ cpu_switchin: lwz %r6, PCB_FLAGS(%r17) /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU - beq .L2 + beq .L3 mr %r3,%r15/* Pass curthread to enable_fpu */ bl enable_fpu +.L3: + lwz %r6, PCB_FLAGS(%r17) + /* Restore Altivec context if needed */ + andi. %r6, %r6, PCB_VEC + beq .L4 + mr %r3,%r15/* Pass curthread to enable_vec */ + bl enable_vec + /* thread to restore is in r3 */ -.L2: +.L4: mr %r3,%r17/* Recover PCB ptr */ lmw %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs */ mr %r2,%r12 Modified: head/sys/powe
svn commit: r188861 - head/sys/dev/ata/chipsets
Author: mav Date: Fri Feb 20 20:20:00 2009 New Revision: 188861 URL: http://svn.freebsd.org/changeset/base/188861 Log: Disable port interrupts before doing PHY reset. PHY reset causes drive connect/disconnect events, unwanted at this moment. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c == --- head/sys/dev/ata/chipsets/ata-ahci.cFri Feb 20 17:48:40 2009 (r188860) +++ head/sys/dev/ata/chipsets/ata-ahci.cFri Feb 20 20:20:00 2009 (r188861) @@ -679,6 +679,9 @@ ata_ahci_reset(device_t dev) u_int32_t signature; int offset = ch->unit << 7; +/* Disable port interrupts */ +ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); + /* setup work areas */ work = ch->dma.work_bus + ATA_AHCI_CL_OFFSET; ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLB + offset, work & 0x); ___ 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: r188862 - head/sys/dev/ata/chipsets
Author: mav Date: Fri Feb 20 20:29:32 2009 New Revision: 188862 URL: http://svn.freebsd.org/changeset/base/188862 Log: Reduce soft-reset assertion time from 5ms to 50us. ATA specification declares minimal reset time of 5us. SATA keeps it, but requires devices to handle commands transmitted even one by one without any gap. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c == --- head/sys/dev/ata/chipsets/ata-ahci.cFri Feb 20 20:20:00 2009 (r188861) +++ head/sys/dev/ata/chipsets/ata-ahci.cFri Feb 20 20:29:32 2009 (r188862) @@ -653,7 +653,7 @@ ata_ahci_softreset(device_t dev, int por device_printf(dev, "setting SRST failed ??\n"); //return -1; -ata_udelay(5000); +ata_udelay(50); /* pull reset inactive -> device softreset */ bzero(ctp->cfis, 64); ___ 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: r188863 - head/sys/net80211
Author: sam Date: Fri Feb 20 21:55:23 2009 New Revision: 188863 URL: http://svn.freebsd.org/changeset/base/188863 Log: misc cleanup of wme parameter setting Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c == --- head/sys/net80211/ieee80211_proto.c Fri Feb 20 20:29:32 2009 (r188862) +++ head/sys/net80211/ieee80211_proto.c Fri Feb 20 21:55:23 2009 (r188863) @@ -819,6 +819,29 @@ static const struct phyParamType bssPhyP }; static void +_setifsparams(struct wmeParams *wmep, const paramType *phy) +{ + wmep->wmep_aifsn = phy->aifsn; + wmep->wmep_logcwmin = phy->logcwmin; + wmep->wmep_logcwmax = phy->logcwmax; + wmep->wmep_txopLimit = phy->txopLimit; +} + +static void +setwmeparams(struct ieee80211vap *vap, const char *type, int ac, + struct wmeParams *wmep, const paramType *phy) +{ + wmep->wmep_acm = phy->acm; + _setifsparams(wmep, phy); + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, + "set %s (%s) [acm %u aifsn %u logcwmin %u logcwmax %u txop %u]\n", + ieee80211_wme_acnames[ac], type, + wmep->wmep_acm, wmep->wmep_aifsn, wmep->wmep_logcwmin, + wmep->wmep_logcwmax, wmep->wmep_txopLimit); +} + +static void ieee80211_wme_initparams_locked(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; @@ -863,49 +886,14 @@ ieee80211_wme_initparams_locked(struct i pBssPhyParam = &bssPhyParamForAC_BE[mode]; break; } - wmep = &wme->wme_wmeChanParams.cap_wmeParams[i]; if (ic->ic_opmode == IEEE80211_M_HOSTAP) { - wmep->wmep_acm = pPhyParam->acm; - wmep->wmep_aifsn = pPhyParam->aifsn; - wmep->wmep_logcwmin = pPhyParam->logcwmin; - wmep->wmep_logcwmax = pPhyParam->logcwmax; - wmep->wmep_txopLimit = pPhyParam->txopLimit; + setwmeparams(vap, "chan", i, wmep, pPhyParam); } else { - wmep->wmep_acm = pBssPhyParam->acm; - wmep->wmep_aifsn = pBssPhyParam->aifsn; - wmep->wmep_logcwmin = pBssPhyParam->logcwmin; - wmep->wmep_logcwmax = pBssPhyParam->logcwmax; - wmep->wmep_txopLimit = pBssPhyParam->txopLimit; - + setwmeparams(vap, "chan", i, wmep, pBssPhyParam); } - IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, - "%s: %s chan [acm %u aifsn %u log2(cwmin) %u " - "log2(cwmax) %u txpoLimit %u]\n", __func__ - , ieee80211_wme_acnames[i] - , wmep->wmep_acm - , wmep->wmep_aifsn - , wmep->wmep_logcwmin - , wmep->wmep_logcwmax - , wmep->wmep_txopLimit - ); - wmep = &wme->wme_wmeBssChanParams.cap_wmeParams[i]; - wmep->wmep_acm = pBssPhyParam->acm; - wmep->wmep_aifsn = pBssPhyParam->aifsn; - wmep->wmep_logcwmin = pBssPhyParam->logcwmin; - wmep->wmep_logcwmax = pBssPhyParam->logcwmax; - wmep->wmep_txopLimit = pBssPhyParam->txopLimit; - IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, - "%s: %s bss [acm %u aifsn %u log2(cwmin) %u " - "log2(cwmax) %u txpoLimit %u]\n", __func__ - , ieee80211_wme_acnames[i] - , wmep->wmep_acm - , wmep->wmep_aifsn - , wmep->wmep_logcwmin - , wmep->wmep_logcwmax - , wmep->wmep_txopLimit - ); + setwmeparams(vap, "bss ", i, wmep, pBssPhyParam); } /* NB: check ic_bss to avoid NULL deref on initial attach */ if (vap->iv_bss != NULL) { @@ -937,7 +925,7 @@ ieee80211_wme_initparams(struct ieee8021 void ieee80211_wme_updateparams_locked(struct ieee80211vap *vap) { - static const paramType phyParam[IEEE80211_MODE_MAX] = { + static const paramType aggrParam[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = { 2, 4, 10, 64, 0 }, [IEEE80211_MODE_11A]= { 2, 4, 10, 64, 0 }, [IEEE80211_MODE_11B]= { 2, 5, 10, 64, 0 }, @@ -958,7 +946,10 @@ ieee80211_wme_updateparams_locked(struct enum ieee80211_phymode mode; int i; - /* set up the channel access parameters for the physical device */ + /* +* Set up the channel access parameters for the physical +* device. First populate the configured settin
svn commit: r188864 - head/sys/net80211
Author: sam Date: Fri Feb 20 21:57:05 2009 New Revision: 188864 URL: http://svn.freebsd.org/changeset/base/188864 Log: o reset aggressive mode flag; it was being left set after marking an interface down o only allow the first vap to initialize shared wme parameters Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c == --- head/sys/net80211/ieee80211_proto.c Fri Feb 20 21:55:23 2009 (r188863) +++ head/sys/net80211/ieee80211_proto.c Fri Feb 20 21:57:05 2009 (r188864) @@ -853,7 +853,7 @@ ieee80211_wme_initparams_locked(struct i IEEE80211_LOCK_ASSERT(ic); - if ((ic->ic_caps & IEEE80211_C_WME) == 0) + if ((ic->ic_caps & IEEE80211_C_WME) == 0 || ic->ic_nrunning > 1) return; /* @@ -905,6 +905,7 @@ ieee80211_wme_initparams_locked(struct i */ wme->wme_hipri_switch_thresh = (HIGH_PRI_SWITCH_THRESH * vap->iv_bss->ni_intval) / 100; + wme->wme_flags &= ~WME_F_AGGRMODE; ieee80211_wme_updateparams(vap); } } ___ 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: r188865 - head/sys/dev/ath/ath_hal
Author: sam Date: Fri Feb 20 22:05:08 2009 New Revision: 188865 URL: http://svn.freebsd.org/changeset/base/188865 Log: don't adjust core clk conversions for 1/2 and 1/4 rate channels; the mac runs at full speed so doing this breaks conversion for ifs parameters Submitted by: Felix Fietkau Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c == --- head/sys/dev/ath/ath_hal/ah.c Fri Feb 20 21:57:05 2009 (r188864) +++ head/sys/dev/ath/ath_hal/ah.c Fri Feb 20 22:05:08 2009 (r188865) @@ -266,10 +266,6 @@ ath_hal_mac_clks(struct ath_hal *ah, u_i clks = usecs * CLOCK_RATE[ath_hal_chan2wmode(ah, c)]; if (IEEE80211_IS_CHAN_HT40(c)) clks <<= 1; - else if (IEEE80211_IS_CHAN_HALF(c)) - clks >>= 1; - else if (IEEE80211_IS_CHAN_QUARTER(c)) - clks >>= 2; } else clks = usecs * CLOCK_RATE[WIRELESS_MODE_11b]; return clks; @@ -286,10 +282,6 @@ ath_hal_mac_usec(struct ath_hal *ah, u_i usec = clks / CLOCK_RATE[ath_hal_chan2wmode(ah, c)]; if (IEEE80211_IS_CHAN_HT40(c)) usec >>= 1; - else if (IEEE80211_IS_CHAN_HALF(c)) - usec <<= 1; - else if (IEEE80211_IS_CHAN_QUARTER(c)) - usec <<= 2; } else usec = clks / CLOCK_RATE[WIRELESS_MODE_11b]; return usec; ___ 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: r188866 - head/sys/dev/ath/ath_hal/ar5212
Author: sam Date: Fri Feb 20 22:06:58 2009 New Revision: 188866 URL: http://svn.freebsd.org/changeset/base/188866 Log: correct SIFS setting; there is a 2usec adjustment between the calculated value and what the hardware requires (based on inspection of INI values) Submitted by: Jiri Fojtasek Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c == --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Feb 20 22:05:08 2009(r188865) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Feb 20 22:06:58 2009(r188866) @@ -450,7 +450,7 @@ ar5212SetSifsTime(struct ath_hal *ah, u_ return AH_FALSE; } else { /* convert to system clocks */ - OS_REG_WRITE(ah, AR_D_GBL_IFS_SIFS, ath_hal_mac_clks(ah, us)); + OS_REG_WRITE(ah, AR_D_GBL_IFS_SIFS, ath_hal_mac_clks(ah, us-2)); ahp->ah_slottime = us; return AH_TRUE; } @@ -460,7 +460,7 @@ u_int ar5212GetSifsTime(struct ath_hal *ah) { u_int clks = OS_REG_READ(ah, AR_D_GBL_IFS_SIFS) & 0x; - return ath_hal_mac_usec(ah, clks); /* convert from system clocks */ + return ath_hal_mac_usec(ah, clks)+2;/* convert from system clocks */ } HAL_BOOL ___ 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: r188867 - head/sys/dev/ata
Author: mav Date: Fri Feb 20 22:46:24 2009 New Revision: 188867 URL: http://svn.freebsd.org/changeset/base/188867 Log: Fix typo: s/SLUMPER/SLUMBER/ Modified: head/sys/dev/ata/ata-all.h Modified: head/sys/dev/ata/ata-all.h == --- head/sys/dev/ata/ata-all.h Fri Feb 20 22:06:58 2009(r188866) +++ head/sys/dev/ata/ata-all.h Fri Feb 20 22:46:24 2009(r188867) @@ -212,7 +212,7 @@ #define ATA_AHCI_P_CMD_NOOP 0x #define ATA_AHCI_P_CMD_ACTIVE 0x1000 #define ATA_AHCI_P_CMD_PARTIAL 0x2000 -#define ATA_AHCI_P_CMD_SLUMPER 0x6000 +#define ATA_AHCI_P_CMD_SLUMBER 0x6000 #define ATA_AHCI_P_TFD 0x120 #define ATA_AHCI_P_SIG 0x124 ___ 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: r188868 - head/sys/dev/ata
Author: marcel Date: Fri Feb 20 23:01:27 2009 New Revision: 188868 URL: http://svn.freebsd.org/changeset/base/188868 Log: Don't read the TOC for DIOCGPROVIDERALIAS. This causes the acd code to create new provider (?), but not from an expected context, which results in a panic (GEOM topology not held). Modified: head/sys/dev/ata/atapi-cd.c Modified: head/sys/dev/ata/atapi-cd.c == --- head/sys/dev/ata/atapi-cd.c Fri Feb 20 22:46:24 2009(r188867) +++ head/sys/dev/ata/atapi-cd.c Fri Feb 20 23:01:27 2009(r188868) @@ -219,7 +219,10 @@ acd_geom_ioctl(struct g_provider *pp, u_ case CDIOCRESET: acd_test_ready(dev); break; - + + case DIOCGPROVIDERALIAS: + break; + default: acd_read_toc(dev); acd_prevent_allow(dev, 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: r188869 - head/sys/net80211
Author: sam Date: Fri Feb 20 23:05:05 2009 New Revision: 188869 URL: http://svn.freebsd.org/changeset/base/188869 Log: mark nodes created by way of neighbor discovery need to be marked as ERP so they get the correct tx parameters setup by node_settxparms Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c == --- head/sys/net80211/ieee80211_node.c Fri Feb 20 23:01:27 2009 (r188868) +++ head/sys/net80211/ieee80211_node.c Fri Feb 20 23:05:05 2009 (r188869) @@ -1319,6 +1319,8 @@ ieee80211_fakeup_adhoc_node(struct ieee8 /* XXX no rate negotiation; just dup */ ni->ni_rates = vap->iv_bss->ni_rates; + if (ieee80211_iserp_rateset(&ni->ni_rates)) + ni->ni_flags |= IEEE80211_NODE_ERP; if (vap->iv_opmode == IEEE80211_M_AHDEMO) { /* * In adhoc demo mode there are no management @@ -1394,6 +1396,8 @@ ieee80211_add_neighbor(struct ieee80211v struct ieee80211com *ic = vap->iv_ic; ieee80211_init_neighbor(ni, wh, sp); + if (ieee80211_iserp_rateset(&ni->ni_rates)) + ni->ni_flags |= IEEE80211_NODE_ERP; node_setuptxparms(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 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: r188877 - head/sys/dev/ata/chipsets
Author: mav Date: Fri Feb 20 23:17:52 2009 New Revision: 188877 URL: http://svn.freebsd.org/changeset/base/188877 Log: Disable port hardware on detach. First switch it to slumber mode to power-down peer transmitter, then disable completely. Side effect of this is saving about 0.5W of power per detached device. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c == --- head/sys/dev/ata/chipsets/ata-ahci.cFri Feb 20 23:16:47 2009 (r188876) +++ head/sys/dev/ata/chipsets/ata-ahci.cFri Feb 20 23:17:52 2009 (r188877) @@ -230,6 +230,22 @@ ata_ahci_ch_attach(device_t dev) int ata_ahci_ch_detach(device_t dev) { +struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); +struct ata_channel *ch = device_get_softc(dev); +int offset = ch->unit << 7; + +/* Disable port interrupts. */ +ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); +/* Reset command register. */ +ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, 0); + +/* Allow everything including partial and slumber modes. */ +ATA_IDX_OUTL(ch, ATA_SCONTROL, 0); +/* Request slumber mode transition and give some time to get there. */ +ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, ATA_AHCI_P_CMD_SLUMBER); +DELAY(100); +/* Disable PHY. */ +ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_DISABLE); ata_dmafini(dev); return (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: r188878 - head/sys/dev/usb2/include
Author: thompsa Date: Sat Feb 21 01:14:49 2009 New Revision: 188878 URL: http://svn.freebsd.org/changeset/base/188878 Log: Provide compat typedefs for usb1. Modified: head/sys/dev/usb2/include/usb2_standard.h Modified: head/sys/dev/usb2/include/usb2_standard.h == --- head/sys/dev/usb2/include/usb2_standard.h Fri Feb 20 23:17:52 2009 (r188877) +++ head/sys/dev/usb2/include/usb2_standard.h Sat Feb 21 01:14:49 2009 (r188878) @@ -109,6 +109,7 @@ struct usb2_device_request { uWord wIndex; uWord wLength; } __packed; +typedef struct usb2_device_request usb_device_request_t; #defineUT_WRITE0x00 #defineUT_READ 0x80 @@ -230,6 +231,7 @@ struct usb2_descriptor { uByte bDescriptorType; uByte bDescriptorSubtype; } __packed; +typedef struct usb2_descriptor usb_descriptor_t; struct usb2_device_descriptor { uByte bLength; @@ -252,6 +254,7 @@ struct usb2_device_descriptor { uByte iSerialNumber; uByte bNumConfigurations; } __packed; +typedef struct usb2_device_descriptor usb_device_descriptor_t; /* Binary Device Object Store (BOS) */ struct usb2_bos_descriptor { @@ -260,6 +263,7 @@ struct usb2_bos_descriptor { uWord wTotalLength; uByte bNumDeviceCaps; } __packed; +typedef struct usb2_bos_descriptor usb_bos_descriptor_t; /* Binary Device Object Store Capability */ struct usb2_bos_cap_descriptor { @@ -273,6 +277,7 @@ struct usb2_bos_cap_descriptor { #defineUSB_DEVCAP_CONTAINER_ID 0x04 /* data ... */ } __packed; +typedef struct usb2_bos_cap_descriptor usb_bos_cap_descriptor_t; struct usb2_devcap_usb2ext_descriptor { uByte bLength; @@ -281,6 +286,7 @@ struct usb2_devcap_usb2ext_descriptor { uByte bmAttributes; #defineUSB_V2EXT_LPM 0x02 } __packed; +typedef struct usb2_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t; struct usb2_devcap_ss_descriptor { uByte bLength; @@ -292,6 +298,7 @@ struct usb2_devcap_ss_descriptor { uByte bU1DevExitLat; uByte bU2DevExitLat; } __packed; +typedef struct usb2_devcap_ss_descriptor usb_devcap_ss_descriptor_t; struct usb2_devcap_container_id_descriptor { uByte bLength; @@ -300,6 +307,8 @@ struct usb2_devcap_container_id_descript uByte bReserved; uByte ContainerID; } __packed; +typedef struct usb2_devcap_container_id_descriptor + usb_devcap_container_id_descriptor_t; /* Device class codes */ #defineUDCLASS_IN_INTERFACE0x00 @@ -330,6 +339,7 @@ struct usb2_config_descriptor { uByte bMaxPower; /* max current in 2 mA units */ #defineUC_POWER_FACTOR 2 } __packed; +typedef struct usb2_config_descriptor usb_config_descriptor_t; struct usb2_interface_descriptor { uByte bLength; @@ -342,6 +352,7 @@ struct usb2_interface_descriptor { uByte bInterfaceProtocol; uByte iInterface; } __packed; +typedef struct usb2_interface_descriptor usb_interface_descriptor_t; struct usb2_interface_assoc_descriptor { uByte bLength; @@ -353,6 +364,7 @@ struct usb2_interface_assoc_descriptor { uByte bFunctionProtocol; uByte iFunction; } __packed; +typedef struct usb2_interface_assoc_descriptor usb_interface_assoc_descriptor_t; /* Interface class codes */ #defineUICLASS_UNSPEC 0x00 @@ -473,6 +485,7 @@ struct usb2_endpoint_descriptor { #defineUE_ZERO_MPS 0x /* for internal use only */ uByte bInterval; } __packed; +typedef struct usb2_endpoint_descriptor usb_endpoint_descriptor_t; struct usb2_endpoint_ss_comp_descriptor { uByte bLength; @@ -481,6 +494,8 @@ struct usb2_endpoint_ss_comp_descriptor uByte bmAttributes; uWord wBytesPerInterval; } __packed; +typedef struct usb2_endpoint_ss_comp_descriptor + usb_endpoint_ss_comp_descriptor_t; struct usb2_string_descriptor { uByte bLength; @@ -488,6 +503,7 @@ struct usb2_string_descriptor { uWord bString[126]; uByte bUnused; } __packed; +typedef struct usb2_string_descriptor usb_string_descriptor_t; #defineUSB_MAKE_STRING_DESC(m,name)\ struct name { \ @@ -529,6 +545,7 @@ struct usb2_hub_descriptor { (((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1) uByte PortPowerCtrlMask[1]; /* deprecated */ } __packed; +typedef struct usb2_hub_descriptor usb_hub_descriptor_t; struct usb2_hub_ss_descriptor { uByte bDescLength; @@ -541,6 +558,7 @@ struct usb2_hub_ss_descriptor { uWord wHubDelay; uByte DeviceRemovable[2]; /* max 15 ports */ } __packed; +typedef struct usb2_hub_ss_descriptor usb_hub_ss_descriptor_t; /* minimum HUB descriptor (8-ports maximum) *
svn commit: r188879 - head/sys/conf
Author: nwhitehorn Date: Sat Feb 21 02:15:08 2009 New Revision: 188879 URL: http://svn.freebsd.org/changeset/base/188879 Log: Include altivec.c, missed on previous commit r188860. This should unbreak the build. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Sat Feb 21 01:14:49 2009(r188878) +++ head/sys/conf/files.powerpc Sat Feb 21 02:15:08 2009(r188879) @@ -126,6 +126,7 @@ powerpc/powermac/uninorth.c optionalpow powerpc/powermac/cuda.coptionalpowermac cuda powerpc/powermac/pmu.c optionalpowermac pmu powerpc/powermac/macgpio.c optionalpowermac pci +powerpc/powerpc/altivec.c optionalaim powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.cstandard ___ 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: r188880 - head/sys/dev/usb2/include
Author: thompsa Date: Sat Feb 21 03:06:29 2009 New Revision: 10 URL: http://svn.freebsd.org/changeset/base/10 Log: Revert r188878 for the moment, this breaks kdump. Modified: head/sys/dev/usb2/include/usb2_standard.h Modified: head/sys/dev/usb2/include/usb2_standard.h == --- head/sys/dev/usb2/include/usb2_standard.h Sat Feb 21 02:15:08 2009 (r188879) +++ head/sys/dev/usb2/include/usb2_standard.h Sat Feb 21 03:06:29 2009 (r10) @@ -109,7 +109,6 @@ struct usb2_device_request { uWord wIndex; uWord wLength; } __packed; -typedef struct usb2_device_request usb_device_request_t; #defineUT_WRITE0x00 #defineUT_READ 0x80 @@ -231,7 +230,6 @@ struct usb2_descriptor { uByte bDescriptorType; uByte bDescriptorSubtype; } __packed; -typedef struct usb2_descriptor usb_descriptor_t; struct usb2_device_descriptor { uByte bLength; @@ -254,7 +252,6 @@ struct usb2_device_descriptor { uByte iSerialNumber; uByte bNumConfigurations; } __packed; -typedef struct usb2_device_descriptor usb_device_descriptor_t; /* Binary Device Object Store (BOS) */ struct usb2_bos_descriptor { @@ -263,7 +260,6 @@ struct usb2_bos_descriptor { uWord wTotalLength; uByte bNumDeviceCaps; } __packed; -typedef struct usb2_bos_descriptor usb_bos_descriptor_t; /* Binary Device Object Store Capability */ struct usb2_bos_cap_descriptor { @@ -277,7 +273,6 @@ struct usb2_bos_cap_descriptor { #defineUSB_DEVCAP_CONTAINER_ID 0x04 /* data ... */ } __packed; -typedef struct usb2_bos_cap_descriptor usb_bos_cap_descriptor_t; struct usb2_devcap_usb2ext_descriptor { uByte bLength; @@ -286,7 +281,6 @@ struct usb2_devcap_usb2ext_descriptor { uByte bmAttributes; #defineUSB_V2EXT_LPM 0x02 } __packed; -typedef struct usb2_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t; struct usb2_devcap_ss_descriptor { uByte bLength; @@ -298,7 +292,6 @@ struct usb2_devcap_ss_descriptor { uByte bU1DevExitLat; uByte bU2DevExitLat; } __packed; -typedef struct usb2_devcap_ss_descriptor usb_devcap_ss_descriptor_t; struct usb2_devcap_container_id_descriptor { uByte bLength; @@ -307,8 +300,6 @@ struct usb2_devcap_container_id_descript uByte bReserved; uByte ContainerID; } __packed; -typedef struct usb2_devcap_container_id_descriptor - usb_devcap_container_id_descriptor_t; /* Device class codes */ #defineUDCLASS_IN_INTERFACE0x00 @@ -339,7 +330,6 @@ struct usb2_config_descriptor { uByte bMaxPower; /* max current in 2 mA units */ #defineUC_POWER_FACTOR 2 } __packed; -typedef struct usb2_config_descriptor usb_config_descriptor_t; struct usb2_interface_descriptor { uByte bLength; @@ -352,7 +342,6 @@ struct usb2_interface_descriptor { uByte bInterfaceProtocol; uByte iInterface; } __packed; -typedef struct usb2_interface_descriptor usb_interface_descriptor_t; struct usb2_interface_assoc_descriptor { uByte bLength; @@ -364,7 +353,6 @@ struct usb2_interface_assoc_descriptor { uByte bFunctionProtocol; uByte iFunction; } __packed; -typedef struct usb2_interface_assoc_descriptor usb_interface_assoc_descriptor_t; /* Interface class codes */ #defineUICLASS_UNSPEC 0x00 @@ -485,7 +473,6 @@ struct usb2_endpoint_descriptor { #defineUE_ZERO_MPS 0x /* for internal use only */ uByte bInterval; } __packed; -typedef struct usb2_endpoint_descriptor usb_endpoint_descriptor_t; struct usb2_endpoint_ss_comp_descriptor { uByte bLength; @@ -494,8 +481,6 @@ struct usb2_endpoint_ss_comp_descriptor uByte bmAttributes; uWord wBytesPerInterval; } __packed; -typedef struct usb2_endpoint_ss_comp_descriptor - usb_endpoint_ss_comp_descriptor_t; struct usb2_string_descriptor { uByte bLength; @@ -503,7 +488,6 @@ struct usb2_string_descriptor { uWord bString[126]; uByte bUnused; } __packed; -typedef struct usb2_string_descriptor usb_string_descriptor_t; #defineUSB_MAKE_STRING_DESC(m,name)\ struct name { \ @@ -545,7 +529,6 @@ struct usb2_hub_descriptor { (((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1) uByte PortPowerCtrlMask[1]; /* deprecated */ } __packed; -typedef struct usb2_hub_descriptor usb_hub_descriptor_t; struct usb2_hub_ss_descriptor { uByte bDescLength; @@ -558,7 +541,6 @@ struct usb2_hub_ss_descriptor { uWord wHubDelay; uByte DeviceRemovable[2]; /* max 15 ports */ } __packed; -typedef struct usb2_hub_ss_descriptor usb_hub_ss_descriptor_t; /* minimum HUB descriptor (8-
svn commit: r188886 - head/usr.bin/talk
Author: delphij Date: Sat Feb 21 03:38:46 2009 New Revision: 16 URL: http://svn.freebsd.org/changeset/base/16 Log: Utilize strlcpy(). Modified: head/usr.bin/talk/get_names.c Modified: head/usr.bin/talk/get_names.c == --- head/usr.bin/talk/get_names.c Sat Feb 21 03:37:10 2009 (r15) +++ head/usr.bin/talk/get_names.c Sat Feb 21 03:38:46 2009 (r16) @@ -113,10 +113,7 @@ get_names(int argc, char *argv[]) msg.addr.sa_family = htons(AF_INET); msg.ctl_addr.sa_family = htons(AF_INET); msg.id_num = htonl(0); - strncpy(msg.l_name, my_name, NAME_SIZE); - msg.l_name[NAME_SIZE - 1] = '\0'; - strncpy(msg.r_name, his_name, NAME_SIZE); - msg.r_name[NAME_SIZE - 1] = '\0'; - strncpy(msg.r_tty, his_tty, TTY_SIZE); - msg.r_tty[TTY_SIZE - 1] = '\0'; + strlcpy(msg.l_name, my_name, NAME_SIZE); + strlcpy(msg.r_name, his_name, NAME_SIZE); + strlcpy(msg.r_tty, his_tty, TTY_SIZE); } ___ 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: r188887 - head/usr.bin/truncate
Author: delphij Date: Sat Feb 21 03:42:31 2009 New Revision: 17 URL: http://svn.freebsd.org/changeset/base/17 Log: Initialize 'sz' as 0. Modified: head/usr.bin/truncate/truncate.c Modified: head/usr.bin/truncate/truncate.c == --- head/usr.bin/truncate/truncate.cSat Feb 21 03:38:46 2009 (r16) +++ head/usr.bin/truncate/truncate.cSat Feb 21 03:42:31 2009 (r17) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2000 Sheldon Hearn . * All rights reserved. * @@ -58,7 +58,7 @@ main(int argc, char **argv) char *fname, *rname; fd = -1; - rsize = tsize = 0; + rsize = tsize = sz = 0; error = 0; rname = NULL; while ((ch = getopt(argc, argv, "cr:s:")) != -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: r188888 - head/usr.bin/vmstat
Author: delphij Date: Sat Feb 21 03:43:20 2009 New Revision: 18 URL: http://svn.freebsd.org/changeset/base/18 Log: Utilize calloc() instead of bzero'ing manually. Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c == --- head/usr.bin/vmstat/vmstat.cSat Feb 21 03:42:31 2009 (r17) +++ head/usr.bin/vmstat/vmstat.cSat Feb 21 03:43:20 2009 (r18) @@ -346,10 +346,8 @@ getdrivedata(char **argv) if ((num_devices = devstat_getnumdevs(NULL)) < 0) errx(1, "%s", devstat_errbuf); - cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); - last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); - bzero(cur.dinfo, sizeof(struct devinfo)); - bzero(last.dinfo, sizeof(struct devinfo)); + cur.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); + last.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); if (devstat_getdevs(NULL, &cur) == -1) errx(1, "%s", devstat_errbuf); @@ -616,10 +614,8 @@ dovmstat(unsigned int interval, int reps if (Pflag) { ncpus = getcpuinfo(&cpumask, &maxid); size_cp_times = sizeof(long) * (maxid + 1) * CPUSTATES; - cur_cp_times = malloc(size_cp_times); - last_cp_times = malloc(size_cp_times); - bzero(cur_cp_times, size_cp_times); - bzero(last_cp_times, size_cp_times); + cur_cp_times = calloc(1, size_cp_times); + last_cp_times = calloc(1, size_cp_times); } for (hdrcnt = 1;;) { if (!--hdrcnt) ___ 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: r188889 - head/usr.bin/printenv
Author: delphij Date: Sat Feb 21 03:50:25 2009 New Revision: 19 URL: http://svn.freebsd.org/changeset/base/19 Log: Define extern **environ in global scope instead of in function. Modified: head/usr.bin/printenv/printenv.c Modified: head/usr.bin/printenv/printenv.c == --- head/usr.bin/printenv/printenv.cSat Feb 21 03:43:20 2009 (r18) +++ head/usr.bin/printenv/printenv.cSat Feb 21 03:50:25 2009 (r19) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. * @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include void usage(void); +extern char **environ; /* * printenv @@ -64,7 +65,6 @@ void usage(void); int main(int argc, char *argv[]) { - extern char **environ; char *cp, **ep; size_t len; int ch; ___ 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: r188890 - head/usr.bin/ktrdump
Author: delphij Date: Sat Feb 21 03:53:06 2009 New Revision: 188890 URL: http://svn.freebsd.org/changeset/base/188890 Log: Remove unnecessary opt* definations. Modified: head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.c == --- head/usr.bin/ktrdump/ktrdump.c Sat Feb 21 03:50:25 2009 (r19) +++ head/usr.bin/ktrdump/ktrdump.c Sat Feb 21 03:53:06 2009 (r188890) @@ -48,9 +48,6 @@ __FBSDID("$FreeBSD$"); #defineUSAGE \ "usage: ktrdump [-cfqrt] [-e execfile] [-i ktrfile] [-m corefile] [-o outfile]\n" -extern char *optarg; -extern int optind; - static void usage(void); static struct nlist nl[] = { ___ 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: r188893 - head/sys/geom/part
Author: marcel Date: Sat Feb 21 07:01:21 2009 New Revision: 188893 URL: http://svn.freebsd.org/changeset/base/188893 Log: Add bootcode handling. Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c == --- head/sys/geom/part/g_part_bsd.c Sat Feb 21 05:54:06 2009 (r188892) +++ head/sys/geom/part/g_part_bsd.c Sat Feb 21 07:01:21 2009 (r188893) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); struct g_part_bsd_table { struct g_part_table base; - u_char *label; + u_char *bbarea; uint32_toffset; }; @@ -58,6 +58,7 @@ struct g_part_bsd_entry { static int g_part_bsd_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); +static int g_part_bsd_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_create(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_destroy(struct g_part_table *, struct g_part_parms *); static void g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, @@ -75,6 +76,7 @@ static int g_part_bsd_write(struct g_par static kobj_method_t g_part_bsd_methods[] = { KOBJMETHOD(g_part_add, g_part_bsd_add), + KOBJMETHOD(g_part_bootcode, g_part_bsd_bootcode), KOBJMETHOD(g_part_create, g_part_bsd_create), KOBJMETHOD(g_part_destroy, g_part_bsd_destroy), KOBJMETHOD(g_part_dumpconf, g_part_bsd_dumpconf), @@ -95,6 +97,7 @@ static struct g_part_scheme g_part_bsd_s .gps_entrysz = sizeof(struct g_part_bsd_entry), .gps_minent = 8, .gps_maxent = 20, + .gps_bootcodesz = BBSIZE, }; G_PART_SCHEME_DECLARE(g_part_bsd); @@ -157,6 +160,30 @@ g_part_bsd_add(struct g_part_table *base } static int +g_part_bsd_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + struct g_part_bsd_table *table; + const u_char *codeptr; + size_t hdsz, tlsz; + size_t codesz, tlofs; + + hdsz = 512; + tlofs = hdsz + 148 + basetable->gpt_entries * 16; + tlsz = BBSIZE - tlofs; + table = (struct g_part_bsd_table *)basetable; + bzero(table->bbarea, hdsz); + bzero(table->bbarea + tlofs, tlsz); + codeptr = gpp->gpp_codeptr; + codesz = MIN(hdsz, gpp->gpp_codesize); + if (codesz > 0) + bcopy(codeptr, table->bbarea, codesz); + codesz = MIN(tlsz, gpp->gpp_codesize - tlofs); + if (codesz > 0) + bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz); + return (0); +} + +static int g_part_bsd_create(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_consumer *cp; @@ -173,13 +200,16 @@ g_part_bsd_create(struct g_part_table *b if (pp->sectorsize < sizeof(struct disklabel)) return (ENOSPC); + if (BBSIZE % pp->sectorsize) + return (ENOTBLK); msize = pp->mediasize / pp->sectorsize; secpercyl = basetable->gpt_sectors * basetable->gpt_heads; ncyls = msize / secpercyl; table = (struct g_part_bsd_table *)basetable; - ptr = table->label = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); + table->bbarea = g_malloc(BBSIZE, M_WAITOK | M_ZERO); + ptr = table->bbarea + pp->sectorsize; le32enc(ptr + 0, DISKMAGIC);/* d_magic */ le32enc(ptr + 40, pp->sectorsize); /* d_secsize */ @@ -284,6 +314,8 @@ g_part_bsd_probe(struct g_part_table *ta if (pp->sectorsize < sizeof(struct disklabel) || pp->mediasize < BBSIZE) return (ENOSPC); + if (BBSIZE % pp->sectorsize) + return (ENOTBLK); /* Check that there's a disklabel. */ buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); @@ -313,11 +345,11 @@ g_part_bsd_read(struct g_part_table *bas table = (struct g_part_bsd_table *)basetable; msize = pp->mediasize / pp->sectorsize; - buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); - if (buf == NULL) + table->bbarea = g_read_data(cp, 0, BBSIZE, &error); + if (table->bbarea == NULL) return (error); - table->label = buf; + buf = table->bbarea + pp->sectorsize; if (le32dec(buf + 40) != pp->sectorsize) goto invalid_label; @@ -388,7 +420,7 @@ g_part_bsd_read(struct g_part_table *bas invalid_label: printf("GEOM: %s: invalid disklabel.\n", pp->name); - g_free(table->label); + g_free(table->bbarea); return (EINVAL); } @@ -421,14 +453,15 @@ g_part_bsd_write(struct g_part_table *ba struct g_part_bsd_entry *entry; struct g_part_bsd_table *table; uint16_t sum; - u_char *p, *pe; + u_char *label, *p, *pe; int error, index; p