<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/aac, branch release/10.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F10.1.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F10.1.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2014-06-04T18:21:33Z</updated>
<entry>
<title>MFC 266281:</title>
<updated>2014-06-04T18:21:33Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2014-06-04T18:21:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=21d64a532fe3e32c82a2b4ed1ee3753e1309581a'/>
<id>urn:sha1:21d64a532fe3e32c82a2b4ed1ee3753e1309581a</id>
<content type='text'>
Clear the data buffer length field when freeing a command structure so that
it doesn't leak through when the command structure is reused for a user
command without a data buffer.

PR:		189668
</content>
</entry>
<entry>
<title>MFC: r260044</title>
<updated>2014-04-25T21:24:33Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2014-04-25T21:24:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4b30cedbf8cb214050d304c8ef5437417e23e4c9'/>
<id>urn:sha1:4b30cedbf8cb214050d304c8ef5437417e23e4c9</id>
<content type='text'>
Free the MSI again on detach if allocated. Arguably, this code would be
better off living in aac_pci.c, but it doesn't seem worth creating a
aac_pci_detach() and it's also not the first PCI-specific bit in aac.c
</content>
</entry>
<entry>
<title>MFC r258779,r258780,r258787,r258822:</title>
<updated>2014-02-04T03:36:42Z</updated>
<author>
<name>Eitan Adler</name>
<email>eadler@FreeBSD.org</email>
</author>
<published>2014-02-04T03:36:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=eca45e57193faeac9fd7a519ed8aef106f2234b5'/>
<id>urn:sha1:eca45e57193faeac9fd7a519ed8aef106f2234b5</id>
<content type='text'>
Fix undefined behavior: (1 &lt;&lt; 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U &lt;&lt; 31) which gets the
expected result.

Similar to the (1 &lt;&lt; 31) case it is not defined to do (2 &lt;&lt; 30).

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.
</content>
</entry>
<entry>
<title>Change the cap_rights_t type from uint64_t to a structure that we can extend</title>
<updated>2013-09-05T00:09:56Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2013-09-05T00:09:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7008be5bd7341259037f383434a72960413cfeb8'/>
<id>urn:sha1:7008be5bd7341259037f383434a72960413cfeb8</id>
<content type='text'>
in the future in a backward compatible (API and ABI) way.

The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.

The structure definition looks like this:

	struct cap_rights {
		uint64_t	cr_rights[CAP_RIGHTS_VERSION + 2];
	};

The initial CAP_RIGHTS_VERSION is 0.

The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.

The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.

To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.

	#define	CAP_PDKILL	CAPRIGHT(1, 0x0000000000000800ULL)

We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:

	#define	CAP_LOOKUP	CAPRIGHT(0, 0x0000000000000400ULL)
	#define	CAP_FCHMOD	CAPRIGHT(0, 0x0000000000002000ULL)

	#define	CAP_FCHMODAT	(CAP_FCHMOD | CAP_LOOKUP)

There is new API to manage the new cap_rights_t structure:

	cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
	void cap_rights_set(cap_rights_t *rights, ...);
	void cap_rights_clear(cap_rights_t *rights, ...);
	bool cap_rights_is_set(const cap_rights_t *rights, ...);

	bool cap_rights_is_valid(const cap_rights_t *rights);
	void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
	void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
	bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);

Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:

	cap_rights_t rights;

	cap_rights_init(&amp;rights, CAP_READ, CAP_WRITE, CAP_FSTAT);

There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:

	#define	cap_rights_set(rights, ...)				\
		__cap_rights_set((rights), __VA_ARGS__, 0ULL)
	void __cap_rights_set(cap_rights_t *rights, ...);

Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:

	cap_rights_init(&amp;rights, CAP_LOOKUP | CAP_PDKILL);

Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.

This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.

Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>- Fix a bug in the MSI allocation logic so an MSI is also employed if a</title>
<updated>2013-08-06T19:14:02Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2013-08-06T19:14:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0cfcfc19187b534c65dd6bf1c4573933f80d78a3'/>
<id>urn:sha1:0cfcfc19187b534c65dd6bf1c4573933f80d78a3</id>
<content type='text'>
  controller supports only a single message. I haven't seen such an adapter
  out in the wild, though, so this change likely is a NOP.
  While at it, further simplify the MSI allocation logic; there's no need
  to check the number of available messages on our own as pci_alloc_msi(9)
  will just fail if it can't provide us with the single message we want.
- Nuke the unused softc of aacch(4).

MFC after:	1 month
</content>
</entry>
<entry>
<title>As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI</title>
<updated>2013-08-06T18:55:59Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2013-08-06T18:55:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=21e5a2223c70047269d7e13ec60332d82f6524dc'/>
<id>urn:sha1:21e5a2223c70047269d7e13ec60332d82f6524dc</id>
<content type='text'>
quirk and apply it to these controllers [1]. The same problem was reported
for 2230S, in which case it wasn't actually clear whether the culprit is the
controller or the mainboard, though. In order to be on the safe side, flag
MSIs as being broken with the latter type of controller as well. Given that
these are the only reports of MSI-related breakage with aac(4) so far and
OSes like OpenSolaris unconditionally employ MSIs for all adapters of this
family, however, it doesn't seem warranted to generally disable the use of
MSIs in aac(4).
While it, simplify the MSI allocation logic a bit; there's no need to check
for the presence of the MSI capability on our own as pci_alloc_msi(9) will
just fail when these kind of interrupts are not available.
Reported and tested by: David Boyd [1]

MFC after:	3 days
</content>
</entry>
<entry>
<title>Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the</title>
<updated>2013-05-30T00:22:07Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2013-05-30T00:22:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8fce673c587333a0b02c9911be7c93dcc29465db'/>
<id>urn:sha1:8fce673c587333a0b02c9911be7c93dcc29465db</id>
<content type='text'>
same support for aacp(4), I'm lacking the necessary hardware for
testing, though.
</content>
</entry>
<entry>
<title>- Remove pointless returns.</title>
<updated>2013-05-30T00:11:22Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2013-05-30T00:11:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5ba8a38ee494ea354c3cf70a22a542a8977eb300'/>
<id>urn:sha1:5ba8a38ee494ea354c3cf70a22a542a8977eb300</id>
<content type='text'>
- Make cm_data a void pointer and cm_flags unsigned as appropriate.

MFC after:	3 days
</content>
</entry>
<entry>
<title>MFprojects/camlock r248982:</title>
<updated>2013-04-14T09:55:48Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2013-04-14T09:55:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e5dfa058dab8fa6b71f15a4212dc1ec68b04bfea'/>
<id>urn:sha1:e5dfa058dab8fa6b71f15a4212dc1ec68b04bfea</id>
<content type='text'>
Stop abusing xpt_periph in random plases that really have no periph related
to CCB, for example, bus scanning.  NULL value is fine in such cases and it
is correctly logged in debug messages as "noperiph".  If at some point we
need some real XPT periphs (alike to pmpX now), quite likely they will be
per-bus, and not a single global instance as xpt_periph now.
</content>
</entry>
<entry>
<title>Initialize count in order to appease clang.</title>
<updated>2013-03-01T22:09:08Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2013-03-01T22:09:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=20132a22383f48c3134cde493d36bebf0c8b464c'/>
<id>urn:sha1:20132a22383f48c3134cde493d36bebf0c8b464c</id>
<content type='text'>
Submitted by:	delphij
</content>
</entry>
</feed>
