From anevilyak at mail.berlios.de Mon Dec 1 15:08:55 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Mon, 1 Dec 2008 15:08:55 +0100 Subject: [Haiku-commits] r28754 - haiku/trunk/src/kits/storage Message-ID: <200812011408.mB1E8tXL017189@sheep.berlios.de> Author: anevilyak Date: 2008-12-01 15:08:53 +0100 (Mon, 01 Dec 2008) New Revision: 28754 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28754&view=rev Modified: haiku/trunk/src/kits/storage/Directory.cpp Log: When comparing paths, we need to ensure that the entry's path does in fact have a path separator at the same position as the original, otherwise we incorrectly indicate containment in some cases. Fixes ticket #3186. Modified: haiku/trunk/src/kits/storage/Directory.cpp =================================================================== --- haiku/trunk/src/kits/storage/Directory.cpp 2008-11-30 22:06:25 UTC (rev 28753) +++ haiku/trunk/src/kits/storage/Directory.cpp 2008-12-01 14:08:53 UTC (rev 28754) @@ -508,7 +508,13 @@ if (dirPath.InitCheck() != B_OK || entryPath.InitCheck() != B_OK) return false; - return !strncmp(dirPath.Path(), entryPath.Path(), strlen(dirPath.Path())); + uint32 dirLen = strlen(dirPath.Path()); + + if (!strncmp(dirPath.Path(), entryPath.Path(), dirLen)) { + if (strlen(entryPath.Path()) > dirLen && entryPath.Path()[dirLen] == '/') + return true; + } + return false; } From axeld at pinc-software.de Mon Dec 1 16:00:00 2008 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 01 Dec 2008 16:00:00 +0100 CET Subject: [Haiku-commits] r28754 - haiku/trunk/src/kits/storage In-Reply-To: <200812011408.mB1E8tXL017189@sheep.berlios.de> Message-ID: <20863869683-BeMail@zon> anevilyak at BerliOS wrote: > + if (!strncmp(dirPath.Path(), entryPath.Path(), dirLen)) { > + if (strlen(entryPath.Path()) > dirLen && > entryPath.Path()[dirLen] == '/') > + return true; > + } > + return false; If entryPath.Path()'s length would be smaller than dirLen, strncmp() wouldn't consider them equal, so you can safely remove that extra strlen() check: return !strncmp(dirPath.Path(), entryPath.Path(), dirLen)) && entryPath.Path()[dirLen] == '/'); Bye, Axel. From anevilyak at gmail.com Mon Dec 1 16:04:10 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Mon, 1 Dec 2008 09:04:10 -0600 Subject: [Haiku-commits] r28754 - haiku/trunk/src/kits/storage In-Reply-To: <20863869683-BeMail@zon> References: <200812011408.mB1E8tXL017189@sheep.berlios.de> <20863869683-BeMail@zon> Message-ID: On Mon, Dec 1, 2008 at 9:00 AM, Axel D?rfler wrote: > If entryPath.Path()'s length would be smaller than dirLen, strncmp() > wouldn't consider them equal, so you can safely remove that extra > strlen() check: What if the directory and entry point to the same thing? strncmp would consider them equal, but Contains() should return false in that case, no? Regards, Rene From axeld at pinc-software.de Mon Dec 1 16:49:18 2008 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 01 Dec 2008 16:49:18 +0100 CET Subject: [Haiku-commits] r28754 - haiku/trunk/src/kits/storage In-Reply-To: Message-ID: <23821252337-BeMail@zon> "Rene Gollent" wrote: > On Mon, Dec 1, 2008 at 9:00 AM, Axel D?rfler > wrote: > > If entryPath.Path()'s length would be smaller than dirLen, > > strncmp() > > wouldn't consider them equal, so you can safely remove that extra > > strlen() check: > What if the directory and entry point to the same thing? strncmp > would > consider them equal, but Contains() should return false in that case, > no? A directory is part of itself in BeOS, at least :-) BDirectory directory("/boot/home"); directory.Contains("/boot/home") -> true Bye, Axel. From anevilyak at gmail.com Mon Dec 1 16:52:25 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Mon, 1 Dec 2008 09:52:25 -0600 Subject: [Haiku-commits] r28754 - haiku/trunk/src/kits/storage In-Reply-To: <23821252337-BeMail@zon> References: <23821252337-BeMail@zon> Message-ID: On Mon, Dec 1, 2008 at 9:49 AM, Axel D?rfler wrote: > "Rene Gollent" wrote: >> On Mon, Dec 1, 2008 at 9:00 AM, Axel D?rfler >> wrote: >> > If entryPath.Path()'s length would be smaller than dirLen, >> > strncmp() >> > wouldn't consider them equal, so you can safely remove that extra >> > strlen() check: >> What if the directory and entry point to the same thing? strncmp >> would >> consider them equal, but Contains() should return false in that case, >> no? > > A directory is part of itself in BeOS, at least :-) > BDirectory directory("/boot/home"); > directory.Contains("/boot/home") -> true > Good to know, will have to take that into account as well then. I don't believe the path returned by BPath::Path() has a trailing slash even if the leaf component is a dir, so just checking for ending with '/' won't be enough to ensure correct behavior there. Will fix it when I get home, unless you want to take care of it before then ;-). Regards, Rene From axeld at pinc-software.de Mon Dec 1 23:13:08 2008 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Mon, 01 Dec 2008 23:13:08 +0100 CET Subject: [Haiku-commits] =?utf-8?q?r28107_-_haiku/trunk/src/add-ons/kernel?= =?utf-8?q?/network/protocols/l2cap?= In-Reply-To: <200810142047.m9EKleVi027210@sheep.berlios.de> Message-ID: <46851276552-BeMail@zon> oruizdorantes at mail.berlios.de wrote: > (so use this commit to correct my remaining bad habits) Sorry for the delay, but since you asked for it: :-) > @@ -0,0 +1,251 @@ > +#include "L2capEndpoint.h" > + > + > +#include > +#include > +#include > + > + > +#include "l2cap_internal.h" > +#include "l2cap_address.h" Includes are ordered alphabetically in the groups, only one blank line between the groups. > +#include What does "cap" of L2capEndpoint stand for? It seems it's a weird combination between small and large caps. > +L2capEndpoint::L2capEndpoint(net_socket* socket) > + : > + ProtocolSocket(socket), The inherited constructor calls usually go to the same line as the ":". > + fPeerEndpoint(NULL), > + fAcceptSemaphore(-1) > +{ > + debugf("[%ld] %p->L2capEndpoint::L2capEndpoint()\n", > find_thread(NULL), this); > + > + > +} No useless whitespace, please :-) > +status_t > +L2capEndpoint::Open() > +{ > + debugf("[%ld] %p->L2capEndpoint::Open()\n", find_thread(NULL), > this); > + > + status_t error = ProtocolSocket::Open(); > + if (error != B_OK) Wrong indentation of the status_t line; you used spaces instead of tabs. > + return(error); > + > + > + > + return(B_OK); > +} No () for return, no useless blank lines (one would have been enough). > +L2capEndpoint* > +L2capEndpoint::ForPsm(uint16 psm) > +{ > + > + L2capEndpoint* endpoint; Again useless blank lines (everywhere), no tab in the variable declaration. > + > + DoublyLinkedList::Iterator iterator = > EndpointList.GetIterator(); > + > + while (iterator.HasNext()) { > + > + endpoint = iterator.Next(); > + if (((struct sockaddr_l2cap*)&endpoint->socket->address)-> > l2cap_psm == psm && > + endpoint->fState == LISTEN) { && goes to the next line. > +++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/ > L2capEndpoint.h 2008-10-14 20:47:20 UTC (rev 28107) > @@ -0,0 +1,95 @@ > +#ifndef L2CAP_ENDPOINT_H > +#define L2CAP_ENDPOINT_H License is missing. > +class L2capEndpoint : public net_protocol, > + public ProtocolSocket, > + public DoublyLinkedListLinkImpl > +{ Indentation... only one *tab* to indent, not a mix between spaces and tabs, and not so many of them. The '{' does not go to a new line. > + > +public: Useless blank line... > +private: > + mutex fLock; > + State fState; Again indenting mix of spaces/tabs. > +#endif // L2cap_ENDPOINT_H Usually we use all caps header guards. > status_t > l2cap_receive_data(net_buffer *buffer) > { > - debugf("received some data, buffer length %lu\n", buffer->size); > + HciConnection* conn = (HciConnection*) buffer; No space between cast and term. > + debugf("received some data, buffer length %lu\n", conn-> > currentRxPacket->size); > + > + l2cap_receive(conn, conn->currentRxPacket); > > - NetBufferHeaderReader bufferHeader(buffer); > - if (bufferHeader.Status() < B_OK) > - return bufferHeader.Status(); > - > - hci_acl_header &header = bufferHeader.Data(); Please use either the "* " or " *" style consistently, don't mix. > +// Configuration options > +struct _cfg_opt_flow { > + l2cap_cfg_opt_t hdr; > + l2cap_flow_t val; > +} __attribute__ ((packed)); We do have a _PACKED() macro for this, btw. > +struct _cfg_opt_mtu { > + l2cap_cfg_opt_t hdr; > + uint16 val; > +} __attribute__ ((packed)); > + > + > + > + > /* L2CAP_CommandRej */ Useless blank lines (still everywhere) :-) > + net_buffer* _m = gBufferModule->create(sizeof(requestedSize)); > + > + if (_m == NULL) > + return NULL; Names like "m" or "_m" are discouraged, please use meaningful names. > + > + if (_flush_timo != NULL) { Same here, also we use inter-caps style, so this should be "flushTimeout" instead. Why the underscore, anyway? > + bufferHeader->hdr.type = L2CAP_OPT_FLUSH_TIMO; > + bufferHeader->hdr.length = sizeof(bufferHeader->val); > + bufferHeader->val = htole16(*(int16 *)(_flush_timo)); > + > + delete &bufferHeader; This looks scary. > -static inline net_buffer* > +net_buffer* > l2cap_info_rsp(uint8 _ident, uint16 _type, uint16 _result, uint16 > _mtu); No newline for the function name in prototypes. That's it for now, most problems are multiplied in the code but only mentioned once here (even the whitespace problem is multiplied, just not mentioned once only) :-) Bye, Axel. From oruizdorantes at mail.berlios.de Tue Dec 2 00:06:02 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Tue, 2 Dec 2008 00:06:02 +0100 Subject: [Haiku-commits] r28755 - haiku/trunk/src/add-ons/kernel/network/protocols/l2cap Message-ID: <200812012306.mB1N62mj022156@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-02 00:06:01 +0100 (Tue, 02 Dec 2008) New Revision: 28755 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28755&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp Log: Really scary, Obviously non tested code freeing stack allocated object. tnx axel Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp 2008-12-01 14:08:53 UTC (rev 28754) +++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp 2008-12-01 23:06:01 UTC (rev 28755) @@ -425,8 +425,6 @@ #endif -#define _ng_l2cap_build_cfg_options(_m, _mtu, _flush_timo, _flow) \ - /* Build configuration options */ net_buffer* l2cap_build_cfg_options(uint16* _mtu, uint16* _flush_timo, l2cap_flow_t* _flow) @@ -460,7 +458,7 @@ bufferHeader->hdr.length = sizeof(bufferHeader->val); bufferHeader->val = htole16(*(uint16 *)(_mtu)); - delete &bufferHeader; + bufferHeader.Sync(); } if (_flush_timo != NULL) { @@ -476,7 +474,7 @@ bufferHeader->hdr.length = sizeof(bufferHeader->val); bufferHeader->val = htole16(*(int16 *)(_flush_timo)); - delete &bufferHeader; + bufferHeader.Sync(); } if (_flow != NULL) { @@ -498,7 +496,7 @@ bufferHeader->val.latency = htole32(_flow->latency); bufferHeader->val.delay_variation = htole32(_flow->delay_variation); - delete &bufferHeader; + bufferHeader.Sync(); } return _m; From oruizdorantes at mail.berlios.de Tue Dec 2 00:09:12 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Tue, 2 Dec 2008 00:09:12 +0100 Subject: [Haiku-commits] r28756 - haiku/trunk/src/add-ons/kernel/network/protocols/l2cap Message-ID: <200812012309.mB1N9C1W022485@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-02 00:09:11 +0100 (Tue, 02 Dec 2008) New Revision: 28756 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28756&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.cpp haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.h haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap.cpp haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.h Log: Style changes whitespaces remaining... what editor do you use to avoid that? Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.cpp 2008-12-01 23:06:01 UTC (rev 28755) +++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.cpp 2008-12-01 23:09:11 UTC (rev 28756) @@ -1,15 +1,23 @@ +/* + * Copyright 2008, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Oliver Ruiz Dorantes, oliver-ruiz.dorantes_at_gmail.com + */ #include "L2capEndpoint.h" +#include "l2cap_address.h" #include +#include #include -#include -#include "l2cap_address.h" #include #define BT_DEBUG_THIS_MODULE #include + static inline bigtime_t absolute_timeout(bigtime_t timeout) { @@ -58,7 +66,7 @@ { debugf("[%ld] %p->L2capEndpoint::Init()\n", find_thread(NULL), this); - return(B_OK); + return B_OK; } @@ -67,7 +75,6 @@ { debugf("[%ld] %p->L2capEndpoint::Uninit()\n", find_thread(NULL), this); - } @@ -76,13 +83,11 @@ { debugf("[%ld] %p->L2capEndpoint::Open()\n", find_thread(NULL), this); - status_t error = ProtocolSocket::Open(); + status_t error = ProtocolSocket::Open(); if (error != B_OK) - return(error); + return error; - - - return(B_OK); + return B_OK; } @@ -91,7 +96,7 @@ { debugf("[%ld] %p->L2capEndpoint::Close()\n", find_thread(NULL), this); - return(B_OK); + return B_OK; } @@ -100,7 +105,7 @@ { debugf("[%ld] %p->L2capEndpoint::Free()\n", find_thread(NULL), this); - return(B_OK); + return B_OK; } @@ -111,7 +116,7 @@ panic("null adrresss!"); if (_address->sa_family != AF_BLUETOOTH ) - return(EAFNOSUPPORT); + return EAFNOSUPPORT; // TODO: Check socladdr_l2cap size @@ -144,7 +149,7 @@ { debugf("[%ld] %p->L2capEndpoint::Unbind()\n", find_thread(NULL), this); - return(B_OK); + return B_OK; } @@ -168,7 +173,7 @@ L2capEndpoint::Connect(const struct sockaddr *_address) { if (_address->sa_family != AF_BLUETOOTH) - return(EAFNOSUPPORT); + return EAFNOSUPPORT; debugf("[%ld] %p->L2capEndpoint::Connect(\"%s\")\n", find_thread(NULL), this, ConstSocketAddress(&gL2cap4AddressModule, _address).AsString().Data()); @@ -232,7 +237,6 @@ { debugf("[%ld] %p->L2capEndpoint::Sendable()\n", find_thread(NULL), this); - return 0; } @@ -257,8 +261,8 @@ while (iterator.HasNext()) { endpoint = iterator.Next(); - if (((struct sockaddr_l2cap*)&endpoint->socket->address)->l2cap_psm == psm && - endpoint->fState == LISTEN) { + if (((struct sockaddr_l2cap*)&endpoint->socket->address)->l2cap_psm == psm + && endpoint->fState == LISTEN) { // TODO endpoint ocupied, lock it! define a channel for it return endpoint; } Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.h =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.h 2008-12-01 23:06:01 UTC (rev 28755) +++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/L2capEndpoint.h 2008-12-01 23:09:11 UTC (rev 28756) @@ -1,7 +1,13 @@ +/* + * Copyright 2008, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Oliver Ruiz Dorantes, oliver-ruiz.dorantes_at_gmail.com + */ #ifndef L2CAP_ENDPOINT_H #define L2CAP_ENDPOINT_H - #include #include @@ -18,8 +24,7 @@ class L2capEndpoint : public net_protocol, public ProtocolSocket, - public DoublyLinkedListLinkImpl -{ + public DoublyLinkedListLinkImpl { public: L2capEndpoint(net_socket* socket); @@ -102,4 +107,4 @@ extern DoublyLinkedList EndpointList; -#endif // L2cap_ENDPOINT_H +#endif // L2CAP_ENDPOINT_H Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap.cpp 2008-12-01 23:06:01 UTC (rev 28755) +++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap.cpp 2008-12-01 23:09:11 UTC (rev 28756) @@ -51,16 +51,16 @@ extern net_protocol_module_info gL2CAPModule; // module references -bluetooth_core_data_module_info *btCoreData; +bluetooth_core_data_module_info* btCoreData; -net_buffer_module_info *gBufferModule; -net_stack_module_info *gStackModule; -net_socket_module_info *gSocketModule; +net_buffer_module_info* gBufferModule; +net_stack_module_info* gStackModule; +net_socket_module_info* gSocketModule; -static struct net_domain *sDomain; +static struct net_domain* sDomain; -net_protocol * -l2cap_init_protocol(net_socket *socket) +net_protocol* +l2cap_init_protocol(net_socket* socket) { flowf("\n"); @@ -75,7 +75,7 @@ status_t -l2cap_uninit_protocol(net_protocol *protocol) +l2cap_uninit_protocol(net_protocol* protocol) { flowf("\n"); @@ -88,7 +88,7 @@ status_t -l2cap_open(net_protocol *protocol) +l2cap_open(net_protocol* protocol) { flowf("\n"); @@ -97,7 +97,7 @@ status_t -l2cap_close(net_protocol *protocol) +l2cap_close(net_protocol* protocol) { flowf("\n"); @@ -106,7 +106,7 @@ status_t -l2cap_free(net_protocol *protocol) +l2cap_free(net_protocol* protocol) { flowf("\n"); @@ -115,7 +115,7 @@ status_t -l2cap_connect(net_protocol *protocol, const struct sockaddr *address) +l2cap_connect(net_protocol* protocol, const struct sockaddr* address) { flowf("\n"); @@ -124,7 +124,7 @@ status_t -l2cap_accept(net_protocol *protocol, struct net_socket **_acceptedSocket) +l2cap_accept(net_protocol* protocol, struct net_socket** _acceptedSocket) { flowf("\n"); @@ -133,8 +133,8 @@ status_t -l2cap_control(net_protocol *protocol, int level, int option, void *value, - size_t *_length) +l2cap_control(net_protocol* protocol, int level, int option, void* value, + size_t* _length) { flowf("\n"); @@ -144,8 +144,8 @@ status_t -l2cap_getsockopt(net_protocol *protocol, int level, int option, - void *value, int *length) +l2cap_getsockopt(net_protocol* protocol, int level, int option, + void* value, int* length) { flowf("\n"); @@ -155,8 +155,8 @@ status_t -l2cap_setsockopt(net_protocol *protocol, int level, int option, - const void *value, int length) +l2cap_setsockopt(net_protocol* protocol, int level, int option, + const void* value, int length) { flowf("\n"); @@ -175,7 +175,7 @@ status_t -l2cap_unbind(net_protocol *protocol, struct sockaddr *address) +l2cap_unbind(net_protocol* protocol, struct sockaddr* address) { flowf("\n"); @@ -184,14 +184,14 @@ status_t -l2cap_listen(net_protocol *protocol, int count) +l2cap_listen(net_protocol* protocol, int count) { return ((L2capEndpoint*)protocol)->Listen(count); } status_t -l2cap_shutdown(net_protocol *protocol, int direction) +l2cap_shutdown(net_protocol* protocol, int direction) { flowf("\n"); @@ -200,7 +200,7 @@ status_t -l2cap_send_data(net_protocol *protocol, net_buffer *buffer) +l2cap_send_data(net_protocol* protocol, net_buffer* buffer) { flowf("\n"); @@ -209,8 +209,8 @@ status_t -l2cap_send_routed_data(net_protocol *protocol, struct net_route *route, - net_buffer *buffer) +l2cap_send_routed_data(net_protocol* protocol, struct net_route* route, + net_buffer* buffer) { flowf("\n"); @@ -219,7 +219,7 @@ ssize_t -l2cap_send_avail(net_protocol *protocol) +l2cap_send_avail(net_protocol* protocol) { flowf("\n"); @@ -228,8 +228,8 @@ status_t -l2cap_read_data(net_protocol *protocol, size_t numBytes, uint32 flags, - net_buffer **_buffer) +l2cap_read_data(net_protocol* protocol, size_t numBytes, uint32 flags, + net_buffer** _buffer) { flowf("\n"); @@ -238,7 +238,7 @@ ssize_t -l2cap_read_avail(net_protocol *protocol) +l2cap_read_avail(net_protocol* protocol) { flowf("\n"); @@ -246,8 +246,8 @@ } -struct net_domain * -l2cap_get_domain(net_protocol *protocol) +struct net_domain* +l2cap_get_domain(net_protocol* protocol) { flowf("\n"); @@ -256,7 +256,7 @@ size_t -l2cap_get_mtu(net_protocol *protocol, const struct sockaddr *address) +l2cap_get_mtu(net_protocol* protocol, const struct sockaddr* address) { flowf("\n"); @@ -265,9 +265,9 @@ status_t -l2cap_receive_data(net_buffer *buffer) +l2cap_receive_data(net_buffer* buffer) { - HciConnection* conn = (HciConnection*) buffer; + HciConnection* conn = (HciConnection*)buffer; debugf("received some data, buffer length %lu\n", conn->currentRxPacket->size); l2cap_receive(conn, conn->currentRxPacket); @@ -277,7 +277,7 @@ status_t -l2cap_error(uint32 code, net_buffer *data) +l2cap_error(uint32 code, net_buffer* data) { flowf("\n"); @@ -286,8 +286,8 @@ status_t -l2cap_error_reply(net_protocol *protocol, net_buffer *causedError, uint32 code, - void *errorData) +l2cap_error_reply(net_protocol* protocol, net_buffer* causedError, uint32 code, + void* errorData) { flowf("\n"); @@ -384,14 +384,14 @@ }; module_dependency module_dependencies[] = { - {NET_STACK_MODULE_NAME, (module_info **)&gStackModule}, - {NET_BUFFER_MODULE_NAME, (module_info **)&gBufferModule}, - {BT_CORE_DATA_MODULE_NAME, (module_info **)&btCoreData}, - {NET_SOCKET_MODULE_NAME, (module_info **)&gSocketModule}, + {NET_STACK_MODULE_NAME, (module_info**)&gStackModule}, + {NET_BUFFER_MODULE_NAME, (module_info**)&gBufferModule}, + {BT_CORE_DATA_MODULE_NAME, (module_info**)&btCoreData}, + {NET_SOCKET_MODULE_NAME, (module_info**)&gSocketModule}, {} }; -module_info *modules[] = { - (module_info *)&gL2CAPModule, +module_info* modules[] = { + (module_info*)&gL2CAPModule, NULL }; Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.h =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.h 2008-12-01 23:06:01 UTC (rev 28755) +++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_address.h 2008-12-01 23:09:11 UTC (rev 28756) @@ -1,12 +1,10 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: * Oliver Ruiz Dorantes, oliver-ruiz.dorantes_at_gmail.com */ - - #ifndef L2CAP_ADDRESS_H #define L2CAP_ADDRESS_H From anevilyak at mail.berlios.de Tue Dec 2 01:19:42 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 2 Dec 2008 01:19:42 +0100 Subject: [Haiku-commits] r28757 - haiku/trunk/src/kits/storage Message-ID: <200812020019.mB20JgPZ022448@sheep.berlios.de> Author: anevilyak Date: 2008-12-02 01:19:40 +0100 (Tue, 02 Dec 2008) New Revision: 28757 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28757&view=rev Modified: haiku/trunk/src/kits/storage/Directory.cpp Log: We need to check if we have an exact match in order to match BeOS's behavior (a directory is considered to contain itself on R5). Nice catch Axel! Modified: haiku/trunk/src/kits/storage/Directory.cpp =================================================================== --- haiku/trunk/src/kits/storage/Directory.cpp 2008-12-01 23:09:11 UTC (rev 28756) +++ haiku/trunk/src/kits/storage/Directory.cpp 2008-12-02 00:19:40 UTC (rev 28757) @@ -511,7 +511,7 @@ uint32 dirLen = strlen(dirPath.Path()); if (!strncmp(dirPath.Path(), entryPath.Path(), dirLen)) { - if (strlen(entryPath.Path()) > dirLen && entryPath.Path()[dirLen] == '/') + if (strlen(entryPath.Path()) == dirLen || entryPath.Path()[dirLen] == '/') return true; } return false; From anevilyak at mail.berlios.de Tue Dec 2 01:41:04 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 2 Dec 2008 01:41:04 +0100 Subject: [Haiku-commits] r28758 - haiku/trunk/src/kits/storage Message-ID: <200812020041.mB20f4D0014845@sheep.berlios.de> Author: anevilyak Date: 2008-12-02 01:41:02 +0100 (Tue, 02 Dec 2008) New Revision: 28758 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28758&view=rev Modified: haiku/trunk/src/kits/storage/Directory.cpp Log: Remove unnecessary length check, and add a clarifying comment. Modified: haiku/trunk/src/kits/storage/Directory.cpp =================================================================== --- haiku/trunk/src/kits/storage/Directory.cpp 2008-12-02 00:19:40 UTC (rev 28757) +++ haiku/trunk/src/kits/storage/Directory.cpp 2008-12-02 00:41:02 UTC (rev 28758) @@ -511,7 +511,9 @@ uint32 dirLen = strlen(dirPath.Path()); if (!strncmp(dirPath.Path(), entryPath.Path(), dirLen)) { - if (strlen(entryPath.Path()) == dirLen || entryPath.Path()[dirLen] == '/') + // if the paths are identical, return a match to stay consistent with + // BeOS behavior. + if (entryPath.Path()[dirLen] == '\0' || entryPath.Path()[dirLen] == '/') return true; } return false; From korli at mail.berlios.de Tue Dec 2 18:11:54 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 2 Dec 2008 18:11:54 +0100 Subject: [Haiku-commits] r28759 - haiku/vendor/freebsd/current/dev/nfe Message-ID: <200812021711.mB2HBsVG011265@sheep.berlios.de> Author: korli Date: 2008-12-02 18:11:53 +0100 (Tue, 02 Dec 2008) New Revision: 28759 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28759&view=rev Modified: haiku/vendor/freebsd/current/dev/nfe/if_nfe.c haiku/vendor/freebsd/current/dev/nfe/if_nfereg.h haiku/vendor/freebsd/current/dev/nfe/if_nfevar.h Log: update nfe to current Modified: haiku/vendor/freebsd/current/dev/nfe/if_nfe.c =================================================================== --- haiku/vendor/freebsd/current/dev/nfe/if_nfe.c 2008-12-02 00:41:02 UTC (rev 28758) +++ haiku/vendor/freebsd/current/dev/nfe/if_nfe.c 2008-12-02 17:11:53 UTC (rev 28759) @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include -__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.21 2007/09/14 05:12:25 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.30 2008/10/03 03:58:16 yongari Exp $"); #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -76,7 +76,7 @@ static int nfe_detach(device_t); static int nfe_suspend(device_t); static int nfe_resume(device_t); -static void nfe_shutdown(device_t); +static int nfe_shutdown(device_t); static void nfe_power(struct nfe_softc *); static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); @@ -89,8 +89,6 @@ static void nfe_alloc_msix(struct nfe_softc *, int); static int nfe_intr(void *); static void nfe_int_task(void *, int); -static void *nfe_jalloc(struct nfe_softc *); -static void nfe_jfree(void *, void *); static __inline void nfe_discard_rxbuf(struct nfe_softc *, int); static __inline void nfe_discard_jrxbuf(struct nfe_softc *, int); static int nfe_newbuf(struct nfe_softc *, int); @@ -98,7 +96,6 @@ static int nfe_rxeof(struct nfe_softc *, int); static int nfe_jrxeof(struct nfe_softc *, int); static void nfe_txeof(struct nfe_softc *); -static struct mbuf *nfe_defrag(struct mbuf *, int, int); static int nfe_encap(struct nfe_softc *, struct mbuf **); static void nfe_setmulti(struct nfe_softc *); static void nfe_tx_task(void *, int); @@ -125,6 +122,9 @@ static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_nfe_proc_limit(SYSCTL_HANDLER_ARGS); +static void nfe_sysctl_node(struct nfe_softc *); +static void nfe_stats_clear(struct nfe_softc *); +static void nfe_stats_update(struct nfe_softc *); #ifdef NFE_DEBUG static int nfedebug = 0; @@ -145,9 +145,6 @@ #define NFE_UNLOCK(_sc) mtx_unlock(&(_sc)->nfe_mtx) #define NFE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->nfe_mtx, MA_OWNED) -#define NFE_JLIST_LOCK(_sc) mtx_lock(&(_sc)->nfe_jlist_mtx) -#define NFE_JLIST_UNLOCK(_sc) mtx_unlock(&(_sc)->nfe_jlist_mtx) - /* Tunables. */ static int msi_disable = 0; static int msix_disable = 0; @@ -243,6 +240,30 @@ "NVIDIA nForce MCP67 Networking Adapter"}, {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_LAN4, "NVIDIA nForce MCP67 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN1, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN2, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN3, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN4, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN1, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN2, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN3, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN4, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN1, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN2, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN3, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN4, + "NVIDIA nForce MCP79 Networking Adapter"}, {0, 0, NULL} }; @@ -326,11 +347,8 @@ mtx_init(&sc->nfe_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); - mtx_init(&sc->nfe_jlist_mtx, "nfe_jlist_mtx", NULL, MTX_DEF); callout_init_mtx(&sc->nfe_stat_ch, &sc->nfe_mtx, 0); TASK_INIT(&sc->nfe_link_task, 0, nfe_link_task, sc); - SLIST_INIT(&sc->nfe_jfree_listhead); - SLIST_INIT(&sc->nfe_jinuse_listhead); pci_enable_busmaster(dev); @@ -439,18 +457,19 @@ break; case PCI_PRODUCT_NVIDIA_MCP51_LAN1: case PCI_PRODUCT_NVIDIA_MCP51_LAN2: - sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT; + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_CK804_LAN1: case PCI_PRODUCT_NVIDIA_CK804_LAN2: case PCI_PRODUCT_NVIDIA_MCP04_LAN1: case PCI_PRODUCT_NVIDIA_MCP04_LAN2: - sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM; + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_MCP55_LAN1: case PCI_PRODUCT_NVIDIA_MCP55_LAN2: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | - NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL; + NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; case PCI_PRODUCT_NVIDIA_MCP61_LAN1: @@ -461,15 +480,36 @@ case PCI_PRODUCT_NVIDIA_MCP67_LAN2: case PCI_PRODUCT_NVIDIA_MCP67_LAN3: case PCI_PRODUCT_NVIDIA_MCP67_LAN4: + case PCI_PRODUCT_NVIDIA_MCP73_LAN1: + case PCI_PRODUCT_NVIDIA_MCP73_LAN2: + case PCI_PRODUCT_NVIDIA_MCP73_LAN3: + case PCI_PRODUCT_NVIDIA_MCP73_LAN4: sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | - NFE_TX_FLOW_CTRL; + NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; + case PCI_PRODUCT_NVIDIA_MCP77_LAN1: + case PCI_PRODUCT_NVIDIA_MCP77_LAN2: + case PCI_PRODUCT_NVIDIA_MCP77_LAN3: + case PCI_PRODUCT_NVIDIA_MCP77_LAN4: + /* XXX flow control */ + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_PWR_MGMT | + NFE_CORRECT_MACADDR | NFE_MIB_V3; + break; + case PCI_PRODUCT_NVIDIA_MCP79_LAN1: + case PCI_PRODUCT_NVIDIA_MCP79_LAN2: + case PCI_PRODUCT_NVIDIA_MCP79_LAN3: + case PCI_PRODUCT_NVIDIA_MCP79_LAN4: + /* XXX flow control */ + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_MIB_V3; + break; case PCI_PRODUCT_NVIDIA_MCP65_LAN1: case PCI_PRODUCT_NVIDIA_MCP65_LAN2: case PCI_PRODUCT_NVIDIA_MCP65_LAN3: case PCI_PRODUCT_NVIDIA_MCP65_LAN4: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | - NFE_PWR_MGMT | NFE_TX_FLOW_CTRL; + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | + NFE_MIB_V2; break; } @@ -516,25 +556,9 @@ goto fail; nfe_alloc_jrx_ring(sc, &sc->jrxq); + /* Create sysctl node. */ + nfe_sysctl_node(sc); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, - &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", - "max number of Rx events to process"); - - sc->nfe_process_limit = NFE_PROC_DEFAULT; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - "process_limit", &sc->nfe_process_limit); - if (error == 0) { - if (sc->nfe_process_limit < NFE_PROC_MIN || - sc->nfe_process_limit > NFE_PROC_MAX) { - device_printf(dev, "process_limit value out of range; " - "using default: %d\n", NFE_PROC_DEFAULT); - sc->nfe_process_limit = NFE_PROC_DEFAULT; - } - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; @@ -714,7 +738,6 @@ sc->nfe_parent_tag = NULL; } - mtx_destroy(&sc->nfe_jlist_mtx); mtx_destroy(&sc->nfe_mtx); return (0); @@ -982,63 +1005,6 @@ return (0); } -/* - * Allocate a jumbo buffer. - */ -static void * -nfe_jalloc(struct nfe_softc *sc) -{ - struct nfe_jpool_entry *entry; - - NFE_JLIST_LOCK(sc); - - entry = SLIST_FIRST(&sc->nfe_jfree_listhead); - - if (entry == NULL) { - NFE_JLIST_UNLOCK(sc); - return (NULL); - } - - SLIST_REMOVE_HEAD(&sc->nfe_jfree_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->nfe_jinuse_listhead, entry, jpool_entries); - - NFE_JLIST_UNLOCK(sc); - - return (sc->jrxq.jslots[entry->slot]); -} - -/* - * Release a jumbo buffer. - */ -static void -nfe_jfree(void *buf, void *args) -{ - struct nfe_softc *sc; - struct nfe_jpool_entry *entry; - int i; - - /* Extract the softc struct pointer. */ - sc = (struct nfe_softc *)args; - KASSERT(sc != NULL, ("%s: can't find softc pointer!", __func__)); - - NFE_JLIST_LOCK(sc); - /* Calculate the slot this buffer belongs to. */ - i = ((vm_offset_t)buf - - (vm_offset_t)sc->jrxq.jpool) / NFE_JLEN; - KASSERT(i >= 0 && i < NFE_JSLOTS, - ("%s: asked to free buffer that we don't manage!", __func__)); - - entry = SLIST_FIRST(&sc->nfe_jinuse_listhead); - KASSERT(entry != NULL, ("%s: buffer not in use!", __func__)); - entry->slot = i; - SLIST_REMOVE_HEAD(&sc->nfe_jinuse_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->nfe_jfree_listhead, entry, jpool_entries); - if (SLIST_EMPTY(&sc->nfe_jinuse_listhead)) - wakeup(sc); - - NFE_JLIST_UNLOCK(sc); -} - struct nfe_dmamap_arg { bus_addr_t nfe_busaddr; }; @@ -1147,8 +1113,6 @@ struct nfe_dmamap_arg ctx; struct nfe_rx_data *data; void *desc; - struct nfe_jpool_entry *entry; - uint8_t *ptr; int i, error, descsize; if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0) @@ -1187,33 +1151,15 @@ goto fail; } - /* Create DMA tag for jumbo buffer blocks. */ - error = bus_dma_tag_create(sc->nfe_parent_tag, - PAGE_SIZE, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - NFE_JMEM, /* maxsize */ - 1, /* nsegments */ - NFE_JMEM, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &ring->jrx_jumbo_tag); - if (error != 0) { - device_printf(sc->nfe_dev, - "could not create jumbo Rx buffer block DMA tag\n"); - goto fail; - } - /* Create DMA tag for jumbo Rx buffers. */ error = bus_dma_tag_create(sc->nfe_parent_tag, PAGE_SIZE, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - NFE_JLEN, /* maxsize */ + MJUM9BYTES, /* maxsize */ 1, /* nsegments */ - NFE_JLEN, /* maxsegsize */ + MJUM9BYTES, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &ring->jrx_data_tag); @@ -1267,46 +1213,6 @@ } } - /* Allocate DMA'able memory and load the DMA map for jumbo buf. */ - error = bus_dmamem_alloc(ring->jrx_jumbo_tag, (void **)&ring->jpool, - BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &ring->jrx_jumbo_map); - if (error != 0) { - device_printf(sc->nfe_dev, - "could not allocate DMA'able memory for jumbo pool\n"); - goto fail; - } - - ctx.nfe_busaddr = 0; - error = bus_dmamap_load(ring->jrx_jumbo_tag, ring->jrx_jumbo_map, - ring->jpool, NFE_JMEM, nfe_dma_map_segs, &ctx, 0); - if (error != 0) { - device_printf(sc->nfe_dev, - "could not load DMA'able memory for jumbo pool\n"); - goto fail; - } - - /* - * Now divide it up into 9K pieces and save the addresses - * in an array. - */ - ptr = ring->jpool; - for (i = 0; i < NFE_JSLOTS; i++) { - ring->jslots[i] = ptr; - ptr += NFE_JLEN; - entry = malloc(sizeof(struct nfe_jpool_entry), M_DEVBUF, - M_WAITOK); - if (entry == NULL) { - device_printf(sc->nfe_dev, - "no memory for jumbo buffers!\n"); - error = ENOMEM; - goto fail; - } - entry->slot = i; - SLIST_INSERT_HEAD(&sc->nfe_jfree_listhead, entry, - jpool_entries); - } - return; fail: @@ -1364,7 +1270,7 @@ desc = ring->jdesc32; descsize = sizeof (struct nfe_desc32); } - bzero(desc, descsize * NFE_RX_RING_COUNT); + bzero(desc, descsize * NFE_JUMBO_RX_RING_COUNT); for (i = 0; i < NFE_JUMBO_RX_RING_COUNT; i++) { if (nfe_jnewbuf(sc, i) != 0) return (ENOBUFS); @@ -1431,7 +1337,6 @@ static void nfe_free_jrx_ring(struct nfe_softc *sc, struct nfe_jrx_ring *ring) { - struct nfe_jpool_entry *entry; struct nfe_rx_data *data; void *desc; int i, descsize; @@ -1439,22 +1344,6 @@ if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0) return; - NFE_JLIST_LOCK(sc); - while ((entry = SLIST_FIRST(&sc->nfe_jinuse_listhead))) { - device_printf(sc->nfe_dev, - "asked to free buffer that is in use!\n"); - SLIST_REMOVE_HEAD(&sc->nfe_jinuse_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->nfe_jfree_listhead, entry, - jpool_entries); - } - - while (!SLIST_EMPTY(&sc->nfe_jfree_listhead)) { - entry = SLIST_FIRST(&sc->nfe_jfree_listhead); - SLIST_REMOVE_HEAD(&sc->nfe_jfree_listhead, jpool_entries); - free(entry, M_DEVBUF); - } - NFE_JLIST_UNLOCK(sc); - if (sc->nfe_flags & NFE_40BIT_ADDR) { desc = ring->jdesc64; descsize = sizeof (struct nfe_desc64); @@ -1492,15 +1381,7 @@ ring->jdesc32 = NULL; ring->jrx_desc_map = NULL; } - /* Destroy jumbo buffer block. */ - if (ring->jrx_jumbo_map != NULL) - bus_dmamap_unload(ring->jrx_jumbo_tag, ring->jrx_jumbo_map); - if (ring->jrx_jumbo_map != NULL) { - bus_dmamem_free(ring->jrx_jumbo_tag, ring->jpool, - ring->jrx_jumbo_map); - ring->jpool = NULL; - ring->jrx_jumbo_map = NULL; - } + if (ring->jrx_desc_tag != NULL) { bus_dma_tag_destroy(ring->jrx_desc_tag); ring->jrx_desc_tag = NULL; @@ -1689,7 +1570,7 @@ nfe_rxeof(sc, count); nfe_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_tx_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_tx_task); if (cmd == POLL_AND_CHECK_STATUS) { if ((r = NFE_READ(sc, sc->nfe_irq_status)) == 0) { @@ -1898,7 +1779,7 @@ if (status == 0 || status == 0xffffffff) return (FILTER_STRAY); nfe_disable_intr(sc); - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_int_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_int_task); return (FILTER_HANDLED); } @@ -1952,12 +1833,12 @@ nfe_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_tx_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_tx_task); NFE_UNLOCK(sc); if (domore || (NFE_READ(sc, sc->nfe_irq_status) != 0)) { - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_int_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_int_task); return; } @@ -2084,24 +1965,15 @@ bus_dma_segment_t segs[1]; bus_dmamap_t map; int nsegs; - void *buf; - MGETHDR(m, M_DONTWAIT, MT_DATA); + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); - buf = nfe_jalloc(sc); - if (buf == NULL) { - m_freem(m); - return (ENOBUFS); - } - /* Attach the buffer to the mbuf. */ - MEXTADD(m, buf, NFE_JLEN, nfe_jfree, (struct nfe_softc *)sc, 0, - EXT_NET_DRV); if ((m->m_flags & M_EXT) == 0) { m_freem(m); return (ENOBUFS); } - m->m_pkthdr.len = m->m_len = NFE_JLEN; + m->m_pkthdr.len = m->m_len = MJUM9BYTES; m_adj(m, ETHER_ALIGN); if (bus_dmamap_load_mbuf_sg(sc->jrxq.jrx_data_tag, @@ -2437,93 +2309,6 @@ } } -/* - * It's copy of ath_defrag(ath(4)). - * - * Defragment an mbuf chain, returning at most maxfrags separate - * mbufs+clusters. If this is not possible NULL is returned and - * the original mbuf chain is left in it's present (potentially - * modified) state. We use two techniques: collapsing consecutive - * mbufs and replacing consecutive mbufs by a cluster. - */ -static struct mbuf * -nfe_defrag(struct mbuf *m0, int how, int maxfrags) -{ - struct mbuf *m, *n, *n2, **prev; - u_int curfrags; - - /* - * Calculate the current number of frags. - */ - curfrags = 0; - for (m = m0; m != NULL; m = m->m_next) - curfrags++; - /* - * First, try to collapse mbufs. Note that we always collapse - * towards the front so we don't need to deal with moving the - * pkthdr. This may be suboptimal if the first mbuf has much - * less data than the following. - */ - m = m0; -again: - for (;;) { - n = m->m_next; - if (n == NULL) - break; - if ((m->m_flags & M_RDONLY) == 0 && - n->m_len < M_TRAILINGSPACE(m)) { - bcopy(mtod(n, void *), mtod(m, char *) + m->m_len, - n->m_len); - m->m_len += n->m_len; - m->m_next = n->m_next; - m_free(n); - if (--curfrags <= maxfrags) - return (m0); - } else - m = n; - } - KASSERT(maxfrags > 1, - ("maxfrags %u, but normal collapse failed", maxfrags)); - /* - * Collapse consecutive mbufs to a cluster. - */ - prev = &m0->m_next; /* NB: not the first mbuf */ - while ((n = *prev) != NULL) { - if ((n2 = n->m_next) != NULL && - n->m_len + n2->m_len < MCLBYTES) { - m = m_getcl(how, MT_DATA, 0); - if (m == NULL) - goto bad; - bcopy(mtod(n, void *), mtod(m, void *), n->m_len); - bcopy(mtod(n2, void *), mtod(m, char *) + n->m_len, - n2->m_len); - m->m_len = n->m_len + n2->m_len; - m->m_next = n2->m_next; - *prev = m; - m_free(n); - m_free(n2); - if (--curfrags <= maxfrags) /* +1 cl -2 mbufs */ - return m0; - /* - * Still not there, try the normal collapse - * again before we allocate another cluster. - */ - goto again; - } - prev = &n->m_next; - } - /* - * No place where we can collapse to a cluster; punt. - * This can occur if, for example, you request 2 frags - * but the packet requires that both be clusters (we - * never reallocate the first mbuf to avoid moving the - * packet header). - */ -bad: - return (NULL); -} - - static int nfe_encap(struct nfe_softc *sc, struct mbuf **m_head) { @@ -2542,7 +2327,7 @@ error = bus_dmamap_load_mbuf_sg(sc->txq.tx_data_tag, map, *m_head, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = nfe_defrag(*m_head, M_DONTWAIT, NFE_MAX_SCATTER); + m = m_collapse(*m_head, M_DONTWAIT, NFE_MAX_SCATTER); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -2808,8 +2593,7 @@ if_printf(ifp, "watchdog timeout (missed Tx interrupts) " "-- recovering\n"); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, - &sc->nfe_tx_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_tx_task); return; } /* Check if we've lost start Tx command. */ @@ -2972,6 +2756,9 @@ NFE_WRITE(sc, NFE_PHY_STATUS, 0xf); + /* Clear hardware stats. */ + nfe_stats_clear(sc); + #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) nfe_disable_intr(sc); @@ -3060,6 +2847,8 @@ tdata->m = NULL; } } + /* Update hardware stats. */ + nfe_stats_update(sc); } @@ -3111,12 +2900,13 @@ mii = device_get_softc(sc->nfe_miibus); mii_tick(mii); + nfe_stats_update(sc); nfe_watchdog(ifp); callout_reset(&sc->nfe_stat_ch, hz, nfe_tick, sc); } -static void +static int nfe_shutdown(device_t dev) { struct nfe_softc *sc; @@ -3129,6 +2919,8 @@ nfe_stop(ifp); /* nfe_reset(sc); */ NFE_UNLOCK(sc); + + return (0); } @@ -3216,3 +3008,199 @@ return (sysctl_int_range(oidp, arg1, arg2, req, NFE_PROC_MIN, NFE_PROC_MAX)); } + + +#define NFE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) +#define NFE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) + +static void +nfe_sysctl_node(struct nfe_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct nfe_hw_stats *stats; + int error; + + stats = &sc->nfe_stats; + ctx = device_get_sysctl_ctx(sc->nfe_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->nfe_dev)); + SYSCTL_ADD_PROC(ctx, child, + OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, + &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", + "max number of Rx events to process"); + + sc->nfe_process_limit = NFE_PROC_DEFAULT; + error = resource_int_value(device_get_name(sc->nfe_dev), + device_get_unit(sc->nfe_dev), "process_limit", + &sc->nfe_process_limit); + if (error == 0) { + if (sc->nfe_process_limit < NFE_PROC_MIN || + sc->nfe_process_limit > NFE_PROC_MAX) { + device_printf(sc->nfe_dev, + "process_limit value out of range; " + "using default: %d\n", NFE_PROC_DEFAULT); + sc->nfe_process_limit = NFE_PROC_DEFAULT; + } + } + + if ((sc->nfe_flags & (NFE_MIB_V1 | NFE_MIB_V2 | NFE_MIB_V3)) == 0) + return; + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "NFE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + + NFE_SYSCTL_STAT_ADD32(ctx, child, "frame_errors", + &stats->rx_frame_errors, "Framing Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "extra_bytes", + &stats->rx_extra_bytes, "Extra Bytes"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "late_cols", + &stats->rx_late_cols, "Late Collisions"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Runts"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "jumbos", + &stats->rx_jumbos, "Jumbos"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fifo_overuns", + &stats->rx_fifo_overuns, "FIFO Overruns"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "crc_errors", + &stats->rx_crc_errors, "CRC Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fae", + &stats->rx_fae, "Frame Alignment Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "len_errors", + &stats->rx_len_errors, "Length Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "unicast", + &stats->rx_unicast, "Unicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multicast", + &stats->rx_multicast, "Multicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "brocadcast", + &stats->rx_broadcast, "Broadcast Frames"); + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", + &stats->rx_octets, "Octets"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "pause", + &stats->rx_pause, "Pause frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "drops", + &stats->rx_drops, "Drop frames"); + } + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", + &stats->tx_octets, "Octets"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "zero_rexmits", + &stats->tx_zero_rexmits, "Zero Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "one_rexmits", + &stats->tx_one_rexmits, "One Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multi_rexmits", + &stats->tx_multi_rexmits, "Multiple Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "late_cols", + &stats->tx_late_cols, "Late Collisions"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fifo_underuns", + &stats->tx_fifo_underuns, "FIFO Underruns"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "carrier_losts", + &stats->tx_carrier_losts, "Carrier Losts"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "excess_deferrals", + &stats->tx_excess_deferals, "Excess Deferrals"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "retry_errors", + &stats->tx_retry_errors, "Retry Errors"); + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + NFE_SYSCTL_STAT_ADD32(ctx, child, "deferrals", + &stats->tx_deferals, "Deferrals"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "frames", + &stats->tx_frames, "Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "pause", + &stats->tx_pause, "Pause Frames"); + } + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + NFE_SYSCTL_STAT_ADD32(ctx, child, "unicast", + &stats->tx_deferals, "Unicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multicast", + &stats->tx_frames, "Multicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "broadcast", + &stats->tx_pause, "Broadcast Frames"); + } +} + +#undef NFE_SYSCTL_STAT_ADD32 +#undef NFE_SYSCTL_STAT_ADD64 + +static void +nfe_stats_clear(struct nfe_softc *sc) +{ + int i, mib_cnt; + + if ((sc->nfe_flags & NFE_MIB_V1) != 0) + mib_cnt = NFE_NUM_MIB_STATV1; + else if ((sc->nfe_flags & (NFE_MIB_V2 | NFE_MIB_V3)) != 0) + mib_cnt = NFE_NUM_MIB_STATV2; + else + return; + + for (i = 0; i < mib_cnt; i += sizeof(uint32_t)) + NFE_READ(sc, NFE_TX_OCTET + i); + + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + NFE_READ(sc, NFE_TX_UNICAST); + NFE_READ(sc, NFE_TX_MULTICAST); + NFE_READ(sc, NFE_TX_BROADCAST); + } +} + +static void +nfe_stats_update(struct nfe_softc *sc) +{ + struct nfe_hw_stats *stats; + + NFE_LOCK_ASSERT(sc); + + if ((sc->nfe_flags & (NFE_MIB_V1 | NFE_MIB_V2 | NFE_MIB_V3)) == 0) + return; + + stats = &sc->nfe_stats; + stats->tx_octets += NFE_READ(sc, NFE_TX_OCTET); + stats->tx_zero_rexmits += NFE_READ(sc, NFE_TX_ZERO_REXMIT); + stats->tx_one_rexmits += NFE_READ(sc, NFE_TX_ONE_REXMIT); + stats->tx_multi_rexmits += NFE_READ(sc, NFE_TX_MULTI_REXMIT); + stats->tx_late_cols += NFE_READ(sc, NFE_TX_LATE_COL); + stats->tx_fifo_underuns += NFE_READ(sc, NFE_TX_FIFO_UNDERUN); + stats->tx_carrier_losts += NFE_READ(sc, NFE_TX_CARRIER_LOST); + stats->tx_excess_deferals += NFE_READ(sc, NFE_TX_EXCESS_DEFERRAL); + stats->tx_retry_errors += NFE_READ(sc, NFE_TX_RETRY_ERROR); + stats->rx_frame_errors += NFE_READ(sc, NFE_RX_FRAME_ERROR); + stats->rx_extra_bytes += NFE_READ(sc, NFE_RX_EXTRA_BYTES); + stats->rx_late_cols += NFE_READ(sc, NFE_RX_LATE_COL); + stats->rx_runts += NFE_READ(sc, NFE_RX_RUNT); + stats->rx_jumbos += NFE_READ(sc, NFE_RX_JUMBO); + stats->rx_fifo_overuns += NFE_READ(sc, NFE_RX_FIFO_OVERUN); + stats->rx_crc_errors += NFE_READ(sc, NFE_RX_CRC_ERROR); + stats->rx_fae += NFE_READ(sc, NFE_RX_FAE); + stats->rx_len_errors += NFE_READ(sc, NFE_RX_LEN_ERROR); + stats->rx_unicast += NFE_READ(sc, NFE_RX_UNICAST); + stats->rx_multicast += NFE_READ(sc, NFE_RX_MULTICAST); + stats->rx_broadcast += NFE_READ(sc, NFE_RX_BROADCAST); + + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + stats->tx_deferals += NFE_READ(sc, NFE_TX_DEFERAL); + stats->tx_frames += NFE_READ(sc, NFE_TX_FRAME); + stats->rx_octets += NFE_READ(sc, NFE_RX_OCTET); + stats->tx_pause += NFE_READ(sc, NFE_TX_PAUSE); + stats->rx_pause += NFE_READ(sc, NFE_RX_PAUSE); + stats->rx_drops += NFE_READ(sc, NFE_RX_DROP); + } + + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + stats->tx_unicast += NFE_READ(sc, NFE_TX_UNICAST); + stats->tx_multicast += NFE_READ(sc, NFE_TX_MULTICAST); + stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); + } +} Modified: haiku/vendor/freebsd/current/dev/nfe/if_nfereg.h =================================================================== --- haiku/vendor/freebsd/current/dev/nfe/if_nfereg.h 2008-12-02 00:41:02 UTC (rev 28758) +++ haiku/vendor/freebsd/current/dev/nfe/if_nfereg.h 2008-12-02 17:11:53 UTC (rev 28759) @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.10 2007/06/12 10:51:47 yongari Exp $ + * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.14 2008/10/03 03:58:16 yongari Exp $ */ #define NFE_RX_RING_COUNT 256 @@ -39,16 +39,7 @@ #define NFE_JUMBO_MTU \ (NFE_JUMBO_FRAMELEN - NFE_RX_HEADERS) #define NFE_MIN_FRAMELEN (ETHER_MIN_LEN - ETHER_CRC_LEN) -#define NFE_JSLOTS ((NFE_JUMBO_RX_RING_COUNT * 3) / 2) -#define NFE_JRAWLEN (NFE_JUMBO_FRAMELEN + ETHER_ALIGN) -#define NFE_JLEN \ - (NFE_JRAWLEN + (sizeof(uint64_t) - (NFE_JRAWLEN % sizeof(uint64_t)))) -#define NFE_JPAGESZ PAGE_SIZE -#define NFE_RESID \ - (NFE_JPAGESZ - (NFE_JLEN * NFE_JSLOTS) % NFE_JPAGESZ) -#define NFE_JMEM ((NFE_JLEN * NFE_JSLOTS) + NFE_RESID) - #define NFE_MAX_SCATTER 32 #define NFE_TSO_MAXSGSIZE 4096 #define NFE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) @@ -96,11 +87,41 @@ #define NFE_PHY_SPEED 0x18c #define NFE_PHY_CTL 0x190 #define NFE_PHY_DATA 0x194 +#define NFE_TX_UNICAST 0x1a0 +#define NFE_TX_MULTICAST 0x1a4 +#define NFE_TX_BROADCAST 0x1a8 #define NFE_WOL_CTL 0x200 #define NFE_PATTERN_CRC 0x204 #define NFE_PATTERN_MASK 0x208 #define NFE_PWR_CAP 0x268 #define NFE_PWR_STATE 0x26c +#define NFE_TX_OCTET 0x280 +#define NFE_TX_ZERO_REXMIT 0x284 +#define NFE_TX_ONE_REXMIT 0x288 +#define NFE_TX_MULTI_REXMIT 0x28c +#define NFE_TX_LATE_COL 0x290 +#define NFE_TX_FIFO_UNDERUN 0x294 +#define NFE_TX_CARRIER_LOST 0x298 +#define NFE_TX_EXCESS_DEFERRAL 0x29c +#define NFE_TX_RETRY_ERROR 0x2a0 +#define NFE_RX_FRAME_ERROR 0x2a4 +#define NFE_RX_EXTRA_BYTES 0x2a8 +#define NFE_RX_LATE_COL 0x2ac +#define NFE_RX_RUNT 0x2b0 +#define NFE_RX_JUMBO 0x2b4 +#define NFE_RX_FIFO_OVERUN 0x2b8 +#define NFE_RX_CRC_ERROR 0x2bc +#define NFE_RX_FAE 0x2c0 +#define NFE_RX_LEN_ERROR 0x2c4 +#define NFE_RX_UNICAST 0x2c8 +#define NFE_RX_MULTICAST 0x2cc +#define NFE_RX_BROADCAST 0x2d0 +#define NFE_TX_DEFERAL 0x2d4 +#define NFE_TX_FRAME 0x2d8 +#define NFE_RX_OCTET 0x2dc +#define NFE_TX_PAUSE 0x2e0 +#define NFE_RX_PAUSE 0x2e4 +#define NFE_RX_DROP 0x2e8 #define NFE_VTAG_CTL 0x300 #define NFE_MSIX_MAP0 0x3e0 #define NFE_MSIX_MAP1 0x3e4 @@ -191,6 +212,10 @@ #define NFE_SEED_100TX 0x00002d00 #define NFE_SEED_1000T 0x00007400 +#define NFE_NUM_MIB_STATV1 21 +#define NFE_NUM_MIB_STATV2 27 +#define NFE_NUM_MIB_STATV3 30 + #define NFE_MSI_MESSAGES 8 #define NFE_MSI_VECTOR_0_ENABLED 0x01 @@ -300,6 +325,18 @@ #define PCI_PRODUCT_NVIDIA_MCP67_LAN2 0x054d #define PCI_PRODUCT_NVIDIA_MCP67_LAN3 0x054e #define PCI_PRODUCT_NVIDIA_MCP67_LAN4 0x054f +#define PCI_PRODUCT_NVIDIA_MCP73_LAN1 0x07dc +#define PCI_PRODUCT_NVIDIA_MCP73_LAN2 0x07dd +#define PCI_PRODUCT_NVIDIA_MCP73_LAN3 0x07de +#define PCI_PRODUCT_NVIDIA_MCP73_LAN4 0x07df +#define PCI_PRODUCT_NVIDIA_MCP77_LAN1 0x0760 +#define PCI_PRODUCT_NVIDIA_MCP77_LAN2 0x0761 +#define PCI_PRODUCT_NVIDIA_MCP77_LAN3 0x0762 +#define PCI_PRODUCT_NVIDIA_MCP77_LAN4 0x0763 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN1 0x0ab0 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN2 0x0ab1 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN3 0x0ab2 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN4 0x0ab3 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2 Modified: haiku/vendor/freebsd/current/dev/nfe/if_nfevar.h =================================================================== --- haiku/vendor/freebsd/current/dev/nfe/if_nfevar.h 2008-12-02 00:41:02 UTC (rev 28758) +++ haiku/vendor/freebsd/current/dev/nfe/if_nfevar.h 2008-12-02 17:11:53 UTC (rev 28759) @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/nfe/if_nfevar.h,v 1.5 2007/07/24 01:11:00 yongari Exp $ + * $FreeBSD: src/sys/dev/nfe/if_nfevar.h,v 1.7 2008/10/03 03:58:16 yongari Exp $ */ struct nfe_tx_data { @@ -36,11 +36,6 @@ int next; }; -struct nfe_jpool_entry { - int slot; - SLIST_ENTRY(nfe_jpool_entry) jpool_entries; -}; - struct nfe_rx_data { bus_dmamap_t rx_data_map; bus_addr_t paddr; @@ -65,8 +60,6 @@ bus_dmamap_t jrx_desc_map; bus_dma_tag_t jrx_jumbo_tag; bus_dmamap_t jrx_jumbo_map; - void *jpool; - caddr_t jslots[NFE_JSLOTS]; bus_addr_t jphysaddr; struct nfe_desc32 *jdesc32; struct nfe_desc64 *jdesc64; @@ -77,6 +70,39 @@ int jnext; }; +struct nfe_hw_stats { + uint64_t rx_octets; + uint32_t rx_frame_errors; + uint32_t rx_extra_bytes; + uint32_t rx_late_cols; + uint32_t rx_runts; + uint32_t rx_jumbos; + uint32_t rx_fifo_overuns; + uint32_t rx_crc_errors; + uint32_t rx_fae; + uint32_t rx_len_errors; + uint32_t rx_unicast; + uint32_t rx_multicast; + uint32_t rx_broadcast; + uint32_t rx_pause; + uint32_t rx_drops; + uint64_t tx_octets; + uint32_t tx_zero_rexmits; + uint32_t tx_one_rexmits; + uint32_t tx_multi_rexmits; + uint32_t tx_late_cols; + uint32_t tx_fifo_underuns; + uint32_t tx_carrier_losts; + uint32_t tx_excess_deferals; + uint32_t tx_retry_errors; + uint32_t tx_deferals; + uint32_t tx_frames; + uint32_t tx_pause; + uint32_t tx_unicast; [... truncated: 33 lines follow ...] From korli at mail.berlios.de Tue Dec 2 18:51:43 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 2 Dec 2008 18:51:43 +0100 Subject: [Haiku-commits] r28760 - in haiku/trunk/src/libs/compat/freebsd_network: . compat/sys Message-ID: <200812021751.mB2HphW4005449@sheep.berlios.de> Author: korli Date: 2008-12-02 18:51:42 +0100 (Tue, 02 Dec 2008) New Revision: 28760 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28760&view=rev Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/sys/mbuf.h haiku/trunk/src/libs/compat/freebsd_network/compat/sys/sysctl.h haiku/trunk/src/libs/compat/freebsd_network/mbuf.c Log: added some missing functions for freebsd current Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/sys/mbuf.h =================================================================== --- haiku/trunk/src/libs/compat/freebsd_network/compat/sys/mbuf.h 2008-12-02 17:11:53 UTC (rev 28759) +++ haiku/trunk/src/libs/compat/freebsd_network/compat/sys/mbuf.h 2008-12-02 17:51:42 UTC (rev 28760) @@ -128,6 +128,7 @@ struct mbuf *m_get(int how, short type); struct mbuf *m_gethdr(int how, short type); +struct mbuf *m_getjcl(int how, short type, int flags, int size); void m_clget(struct mbuf *m, int how); void *m_cljget(struct mbuf *m, int how, int size); Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/sys/sysctl.h =================================================================== --- haiku/trunk/src/libs/compat/freebsd_network/compat/sys/sysctl.h 2008-12-02 17:11:53 UTC (rev 28759) +++ haiku/trunk/src/libs/compat/freebsd_network/compat/sys/sysctl.h 2008-12-02 17:51:42 UTC (rev 28760) @@ -65,6 +65,7 @@ static inline int sysctl_handle_long(SYSCTL_HANDLER_ARGS) { return -1; } static inline int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS) { return -1; } +static inline int sysctl_handle_quad(SYSCTL_HANDLER_ARGS) { return -1; } static inline int sysctl_handle_int(SYSCTL_HANDLER_ARGS) { return -1; } static inline int sysctl_handle_string(SYSCTL_HANDLER_ARGS) { return -1; } @@ -98,6 +99,10 @@ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|(access), \ ptr, 0, sysctl_handle_long, "LU", __DESCR(descr)) +#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \ + sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_QUAD|(access), \ + ptr, 0, sysctl_handle_quad, "Q", __DESCR(descr)) + #define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \ ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr)) Modified: haiku/trunk/src/libs/compat/freebsd_network/mbuf.c =================================================================== --- haiku/trunk/src/libs/compat/freebsd_network/mbuf.c 2008-12-02 17:11:53 UTC (rev 28759) +++ haiku/trunk/src/libs/compat/freebsd_network/mbuf.c 2008-12-02 17:51:42 UTC (rev 28760) @@ -169,6 +169,22 @@ } +struct mbuf * +m_getjcl(int how, short type, int flags, int size) +{ + struct mbuf *mb = + (struct mbuf *)object_cache_alloc(sMBufCache, m_to_oc_flags(how)); + if (mb == NULL) + return NULL; + if (construct_ext_sized_mbuf(mb, how, size) < 0) { + object_cache_free(sMBufCache, mb); + return NULL; + } + mb->m_flags |= flags; + return mb; +} + + void m_clget(struct mbuf *m, int how) { From korli at mail.berlios.de Tue Dec 2 18:52:41 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 2 Dec 2008 18:52:41 +0100 Subject: [Haiku-commits] r28761 - in haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev: mii nfe Message-ID: <200812021752.mB2Hqfvh006455@sheep.berlios.de> Author: korli Date: 2008-12-02 18:52:30 +0100 (Tue, 02 Dec 2008) New Revision: 28761 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28761&view=rev Removed: haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/mii/miidevs.h Modified: haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/mii/Jamfile haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfe.c haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfereg.h haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfevar.h Log: * merge current nfe driver from FreeBSD * now uses the generated miidevs header Modified: haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/mii/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/mii/Jamfile 2008-12-02 17:51:42 UTC (rev 28760) +++ haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/mii/Jamfile 2008-12-02 17:52:30 UTC (rev 28761) @@ -13,3 +13,7 @@ ukphy.c ukphy_subr.c ; + +ObjectHdrs [ FGristFiles ciphy$(SUFOBJ) ] + : [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR) libs compat freebsd_network ] ; +Includes [ FGristFiles ciphy.c ] : miidevs.h ; \ No newline at end of file Deleted: haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/mii/miidevs.h Modified: haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfe.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfe.c 2008-12-02 17:51:42 UTC (rev 28760) +++ haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfe.c 2008-12-02 17:52:30 UTC (rev 28761) @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include -__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.21 2007/09/14 05:12:25 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.30 2008/10/03 03:58:16 yongari Exp $"); #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -76,7 +76,7 @@ static int nfe_detach(device_t); static int nfe_suspend(device_t); static int nfe_resume(device_t); -static void nfe_shutdown(device_t); +static int nfe_shutdown(device_t); static void nfe_power(struct nfe_softc *); static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); @@ -89,8 +89,6 @@ static void nfe_alloc_msix(struct nfe_softc *, int); static int nfe_intr(void *); static void nfe_int_task(void *, int); -static void *nfe_jalloc(struct nfe_softc *); -static void nfe_jfree(void *, void *); static __inline void nfe_discard_rxbuf(struct nfe_softc *, int); static __inline void nfe_discard_jrxbuf(struct nfe_softc *, int); static int nfe_newbuf(struct nfe_softc *, int); @@ -98,7 +96,6 @@ static int nfe_rxeof(struct nfe_softc *, int); static int nfe_jrxeof(struct nfe_softc *, int); static void nfe_txeof(struct nfe_softc *); -static struct mbuf *nfe_defrag(struct mbuf *, int, int); static int nfe_encap(struct nfe_softc *, struct mbuf **); static void nfe_setmulti(struct nfe_softc *); static void nfe_tx_task(void *, int); @@ -125,6 +122,9 @@ static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_nfe_proc_limit(SYSCTL_HANDLER_ARGS); +static void nfe_sysctl_node(struct nfe_softc *); +static void nfe_stats_clear(struct nfe_softc *); +static void nfe_stats_update(struct nfe_softc *); #ifdef NFE_DEBUG static int nfedebug = 0; @@ -145,9 +145,6 @@ #define NFE_UNLOCK(_sc) mtx_unlock(&(_sc)->nfe_mtx) #define NFE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->nfe_mtx, MA_OWNED) -#define NFE_JLIST_LOCK(_sc) mtx_lock(&(_sc)->nfe_jlist_mtx) -#define NFE_JLIST_UNLOCK(_sc) mtx_unlock(&(_sc)->nfe_jlist_mtx) - /* Tunables. */ static int msi_disable = 0; static int msix_disable = 0; @@ -243,6 +240,30 @@ "NVIDIA nForce MCP67 Networking Adapter"}, {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_LAN4, "NVIDIA nForce MCP67 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN1, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN2, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN3, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN4, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN1, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN2, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN3, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN4, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN1, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN2, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN3, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN4, + "NVIDIA nForce MCP79 Networking Adapter"}, {0, 0, NULL} }; @@ -326,11 +347,8 @@ mtx_init(&sc->nfe_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); - mtx_init(&sc->nfe_jlist_mtx, "nfe_jlist_mtx", NULL, MTX_DEF); callout_init_mtx(&sc->nfe_stat_ch, &sc->nfe_mtx, 0); TASK_INIT(&sc->nfe_link_task, 0, nfe_link_task, sc); - SLIST_INIT(&sc->nfe_jfree_listhead); - SLIST_INIT(&sc->nfe_jinuse_listhead); pci_enable_busmaster(dev); @@ -439,18 +457,19 @@ break; case PCI_PRODUCT_NVIDIA_MCP51_LAN1: case PCI_PRODUCT_NVIDIA_MCP51_LAN2: - sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT; + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_CK804_LAN1: case PCI_PRODUCT_NVIDIA_CK804_LAN2: case PCI_PRODUCT_NVIDIA_MCP04_LAN1: case PCI_PRODUCT_NVIDIA_MCP04_LAN2: - sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM; + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_MCP55_LAN1: case PCI_PRODUCT_NVIDIA_MCP55_LAN2: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | - NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL; + NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; case PCI_PRODUCT_NVIDIA_MCP61_LAN1: @@ -461,15 +480,36 @@ case PCI_PRODUCT_NVIDIA_MCP67_LAN2: case PCI_PRODUCT_NVIDIA_MCP67_LAN3: case PCI_PRODUCT_NVIDIA_MCP67_LAN4: + case PCI_PRODUCT_NVIDIA_MCP73_LAN1: + case PCI_PRODUCT_NVIDIA_MCP73_LAN2: + case PCI_PRODUCT_NVIDIA_MCP73_LAN3: + case PCI_PRODUCT_NVIDIA_MCP73_LAN4: sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | - NFE_TX_FLOW_CTRL; + NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; + case PCI_PRODUCT_NVIDIA_MCP77_LAN1: + case PCI_PRODUCT_NVIDIA_MCP77_LAN2: + case PCI_PRODUCT_NVIDIA_MCP77_LAN3: + case PCI_PRODUCT_NVIDIA_MCP77_LAN4: + /* XXX flow control */ + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_PWR_MGMT | + NFE_CORRECT_MACADDR | NFE_MIB_V3; + break; + case PCI_PRODUCT_NVIDIA_MCP79_LAN1: + case PCI_PRODUCT_NVIDIA_MCP79_LAN2: + case PCI_PRODUCT_NVIDIA_MCP79_LAN3: + case PCI_PRODUCT_NVIDIA_MCP79_LAN4: + /* XXX flow control */ + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_MIB_V3; + break; case PCI_PRODUCT_NVIDIA_MCP65_LAN1: case PCI_PRODUCT_NVIDIA_MCP65_LAN2: case PCI_PRODUCT_NVIDIA_MCP65_LAN3: case PCI_PRODUCT_NVIDIA_MCP65_LAN4: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | - NFE_PWR_MGMT | NFE_TX_FLOW_CTRL; + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | + NFE_MIB_V2; break; } @@ -516,25 +556,9 @@ goto fail; nfe_alloc_jrx_ring(sc, &sc->jrxq); + /* Create sysctl node. */ + nfe_sysctl_node(sc); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, - &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", - "max number of Rx events to process"); - - sc->nfe_process_limit = NFE_PROC_DEFAULT; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - "process_limit", &sc->nfe_process_limit); - if (error == 0) { - if (sc->nfe_process_limit < NFE_PROC_MIN || - sc->nfe_process_limit > NFE_PROC_MAX) { - device_printf(dev, "process_limit value out of range; " - "using default: %d\n", NFE_PROC_DEFAULT); - sc->nfe_process_limit = NFE_PROC_DEFAULT; - } - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; @@ -714,7 +738,6 @@ sc->nfe_parent_tag = NULL; } - mtx_destroy(&sc->nfe_jlist_mtx); mtx_destroy(&sc->nfe_mtx); return (0); @@ -982,63 +1005,6 @@ return (0); } -/* - * Allocate a jumbo buffer. - */ -static void * -nfe_jalloc(struct nfe_softc *sc) -{ - struct nfe_jpool_entry *entry; - - NFE_JLIST_LOCK(sc); - - entry = SLIST_FIRST(&sc->nfe_jfree_listhead); - - if (entry == NULL) { - NFE_JLIST_UNLOCK(sc); - return (NULL); - } - - SLIST_REMOVE_HEAD(&sc->nfe_jfree_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->nfe_jinuse_listhead, entry, jpool_entries); - - NFE_JLIST_UNLOCK(sc); - - return (sc->jrxq.jslots[entry->slot]); -} - -/* - * Release a jumbo buffer. - */ -static void -nfe_jfree(void *buf, void *args) -{ - struct nfe_softc *sc; - struct nfe_jpool_entry *entry; - int i; - - /* Extract the softc struct pointer. */ - sc = (struct nfe_softc *)args; - KASSERT(sc != NULL, ("%s: can't find softc pointer!", __func__)); - - NFE_JLIST_LOCK(sc); - /* Calculate the slot this buffer belongs to. */ - i = ((vm_offset_t)buf - - (vm_offset_t)sc->jrxq.jpool) / NFE_JLEN; - KASSERT(i >= 0 && i < NFE_JSLOTS, - ("%s: asked to free buffer that we don't manage!", __func__)); - - entry = SLIST_FIRST(&sc->nfe_jinuse_listhead); - KASSERT(entry != NULL, ("%s: buffer not in use!", __func__)); - entry->slot = i; - SLIST_REMOVE_HEAD(&sc->nfe_jinuse_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->nfe_jfree_listhead, entry, jpool_entries); - if (SLIST_EMPTY(&sc->nfe_jinuse_listhead)) - wakeup(sc); - - NFE_JLIST_UNLOCK(sc); -} - struct nfe_dmamap_arg { bus_addr_t nfe_busaddr; }; @@ -1147,8 +1113,6 @@ struct nfe_dmamap_arg ctx; struct nfe_rx_data *data; void *desc; - struct nfe_jpool_entry *entry; - uint8_t *ptr; int i, error, descsize; if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0) @@ -1187,33 +1151,15 @@ goto fail; } - /* Create DMA tag for jumbo buffer blocks. */ - error = bus_dma_tag_create(sc->nfe_parent_tag, - PAGE_SIZE, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - NFE_JMEM, /* maxsize */ - 1, /* nsegments */ - NFE_JMEM, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &ring->jrx_jumbo_tag); - if (error != 0) { - device_printf(sc->nfe_dev, - "could not create jumbo Rx buffer block DMA tag\n"); - goto fail; - } - /* Create DMA tag for jumbo Rx buffers. */ error = bus_dma_tag_create(sc->nfe_parent_tag, PAGE_SIZE, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - NFE_JLEN, /* maxsize */ + MJUM9BYTES, /* maxsize */ 1, /* nsegments */ - NFE_JLEN, /* maxsegsize */ + MJUM9BYTES, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &ring->jrx_data_tag); @@ -1267,46 +1213,6 @@ } } - /* Allocate DMA'able memory and load the DMA map for jumbo buf. */ - error = bus_dmamem_alloc(ring->jrx_jumbo_tag, (void **)&ring->jpool, - BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &ring->jrx_jumbo_map); - if (error != 0) { - device_printf(sc->nfe_dev, - "could not allocate DMA'able memory for jumbo pool\n"); - goto fail; - } - - ctx.nfe_busaddr = 0; - error = bus_dmamap_load(ring->jrx_jumbo_tag, ring->jrx_jumbo_map, - ring->jpool, NFE_JMEM, nfe_dma_map_segs, &ctx, 0); - if (error != 0) { - device_printf(sc->nfe_dev, - "could not load DMA'able memory for jumbo pool\n"); - goto fail; - } - - /* - * Now divide it up into 9K pieces and save the addresses - * in an array. - */ - ptr = ring->jpool; - for (i = 0; i < NFE_JSLOTS; i++) { - ring->jslots[i] = ptr; - ptr += NFE_JLEN; - entry = malloc(sizeof(struct nfe_jpool_entry), M_DEVBUF, - M_WAITOK); - if (entry == NULL) { - device_printf(sc->nfe_dev, - "no memory for jumbo buffers!\n"); - error = ENOMEM; - goto fail; - } - entry->slot = i; - SLIST_INSERT_HEAD(&sc->nfe_jfree_listhead, entry, - jpool_entries); - } - return; fail: @@ -1364,7 +1270,7 @@ desc = ring->jdesc32; descsize = sizeof (struct nfe_desc32); } - bzero(desc, descsize * NFE_RX_RING_COUNT); + bzero(desc, descsize * NFE_JUMBO_RX_RING_COUNT); for (i = 0; i < NFE_JUMBO_RX_RING_COUNT; i++) { if (nfe_jnewbuf(sc, i) != 0) return (ENOBUFS); @@ -1431,7 +1337,6 @@ static void nfe_free_jrx_ring(struct nfe_softc *sc, struct nfe_jrx_ring *ring) { - struct nfe_jpool_entry *entry; struct nfe_rx_data *data; void *desc; int i, descsize; @@ -1439,22 +1344,6 @@ if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0) return; - NFE_JLIST_LOCK(sc); - while ((entry = SLIST_FIRST(&sc->nfe_jinuse_listhead))) { - device_printf(sc->nfe_dev, - "asked to free buffer that is in use!\n"); - SLIST_REMOVE_HEAD(&sc->nfe_jinuse_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->nfe_jfree_listhead, entry, - jpool_entries); - } - - while (!SLIST_EMPTY(&sc->nfe_jfree_listhead)) { - entry = SLIST_FIRST(&sc->nfe_jfree_listhead); - SLIST_REMOVE_HEAD(&sc->nfe_jfree_listhead, jpool_entries); - free(entry, M_DEVBUF); - } - NFE_JLIST_UNLOCK(sc); - if (sc->nfe_flags & NFE_40BIT_ADDR) { desc = ring->jdesc64; descsize = sizeof (struct nfe_desc64); @@ -1492,15 +1381,7 @@ ring->jdesc32 = NULL; ring->jrx_desc_map = NULL; } - /* Destroy jumbo buffer block. */ - if (ring->jrx_jumbo_map != NULL) - bus_dmamap_unload(ring->jrx_jumbo_tag, ring->jrx_jumbo_map); - if (ring->jrx_jumbo_map != NULL) { - bus_dmamem_free(ring->jrx_jumbo_tag, ring->jpool, - ring->jrx_jumbo_map); - ring->jpool = NULL; - ring->jrx_jumbo_map = NULL; - } + if (ring->jrx_desc_tag != NULL) { bus_dma_tag_destroy(ring->jrx_desc_tag); ring->jrx_desc_tag = NULL; @@ -1689,7 +1570,7 @@ nfe_rxeof(sc, count); nfe_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_tx_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_tx_task); if (cmd == POLL_AND_CHECK_STATUS) { if ((r = NFE_READ(sc, sc->nfe_irq_status)) == 0) { @@ -1898,7 +1779,7 @@ if (status == 0 || status == 0xffffffff) return (FILTER_STRAY); nfe_disable_intr(sc); - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_int_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_int_task); return (FILTER_HANDLED); } @@ -1952,12 +1833,12 @@ nfe_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_tx_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_tx_task); NFE_UNLOCK(sc); if (domore || (NFE_READ(sc, sc->nfe_irq_status) != 0)) { - taskqueue_enqueue_fast(taskqueue_fast, &sc->nfe_int_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_int_task); return; } @@ -2084,24 +1965,15 @@ bus_dma_segment_t segs[1]; bus_dmamap_t map; int nsegs; - void *buf; - MGETHDR(m, M_DONTWAIT, MT_DATA); + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); - buf = nfe_jalloc(sc); - if (buf == NULL) { - m_freem(m); - return (ENOBUFS); - } - /* Attach the buffer to the mbuf. */ - MEXTADD(m, buf, NFE_JLEN, nfe_jfree, (struct nfe_softc *)sc, 0, - EXT_NET_DRV); if ((m->m_flags & M_EXT) == 0) { m_freem(m); return (ENOBUFS); } - m->m_pkthdr.len = m->m_len = NFE_JLEN; + m->m_pkthdr.len = m->m_len = MJUM9BYTES; m_adj(m, ETHER_ALIGN); if (bus_dmamap_load_mbuf_sg(sc->jrxq.jrx_data_tag, @@ -2437,93 +2309,6 @@ } } -/* - * It's copy of ath_defrag(ath(4)). - * - * Defragment an mbuf chain, returning at most maxfrags separate - * mbufs+clusters. If this is not possible NULL is returned and - * the original mbuf chain is left in it's present (potentially - * modified) state. We use two techniques: collapsing consecutive - * mbufs and replacing consecutive mbufs by a cluster. - */ -static struct mbuf * -nfe_defrag(struct mbuf *m0, int how, int maxfrags) -{ - struct mbuf *m, *n, *n2, **prev; - u_int curfrags; - - /* - * Calculate the current number of frags. - */ - curfrags = 0; - for (m = m0; m != NULL; m = m->m_next) - curfrags++; - /* - * First, try to collapse mbufs. Note that we always collapse - * towards the front so we don't need to deal with moving the - * pkthdr. This may be suboptimal if the first mbuf has much - * less data than the following. - */ - m = m0; -again: - for (;;) { - n = m->m_next; - if (n == NULL) - break; - if ((m->m_flags & M_RDONLY) == 0 && - n->m_len < M_TRAILINGSPACE(m)) { - bcopy(mtod(n, void *), mtod(m, char *) + m->m_len, - n->m_len); - m->m_len += n->m_len; - m->m_next = n->m_next; - m_free(n); - if (--curfrags <= maxfrags) - return (m0); - } else - m = n; - } - KASSERT(maxfrags > 1, - ("maxfrags %u, but normal collapse failed", maxfrags)); - /* - * Collapse consecutive mbufs to a cluster. - */ - prev = &m0->m_next; /* NB: not the first mbuf */ - while ((n = *prev) != NULL) { - if ((n2 = n->m_next) != NULL && - n->m_len + n2->m_len < MCLBYTES) { - m = m_getcl(how, MT_DATA, 0); - if (m == NULL) - goto bad; - bcopy(mtod(n, void *), mtod(m, void *), n->m_len); - bcopy(mtod(n2, void *), mtod(m, char *) + n->m_len, - n2->m_len); - m->m_len = n->m_len + n2->m_len; - m->m_next = n2->m_next; - *prev = m; - m_free(n); - m_free(n2); - if (--curfrags <= maxfrags) /* +1 cl -2 mbufs */ - return m0; - /* - * Still not there, try the normal collapse - * again before we allocate another cluster. - */ - goto again; - } - prev = &n->m_next; - } - /* - * No place where we can collapse to a cluster; punt. - * This can occur if, for example, you request 2 frags - * but the packet requires that both be clusters (we - * never reallocate the first mbuf to avoid moving the - * packet header). - */ -bad: - return (NULL); -} - - static int nfe_encap(struct nfe_softc *sc, struct mbuf **m_head) { @@ -2542,7 +2327,7 @@ error = bus_dmamap_load_mbuf_sg(sc->txq.tx_data_tag, map, *m_head, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = nfe_defrag(*m_head, M_DONTWAIT, NFE_MAX_SCATTER); + m = m_collapse(*m_head, M_DONTWAIT, NFE_MAX_SCATTER); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -2808,8 +2593,7 @@ if_printf(ifp, "watchdog timeout (missed Tx interrupts) " "-- recovering\n"); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, - &sc->nfe_tx_task); + taskqueue_enqueue_fast(sc->nfe_tq, &sc->nfe_tx_task); return; } /* Check if we've lost start Tx command. */ @@ -2972,6 +2756,9 @@ NFE_WRITE(sc, NFE_PHY_STATUS, 0xf); + /* Clear hardware stats. */ + nfe_stats_clear(sc); + #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) nfe_disable_intr(sc); @@ -3060,6 +2847,8 @@ tdata->m = NULL; } } + /* Update hardware stats. */ + nfe_stats_update(sc); } @@ -3111,12 +2900,13 @@ mii = device_get_softc(sc->nfe_miibus); mii_tick(mii); + nfe_stats_update(sc); nfe_watchdog(ifp); callout_reset(&sc->nfe_stat_ch, hz, nfe_tick, sc); } -static void +static int nfe_shutdown(device_t dev) { struct nfe_softc *sc; @@ -3129,6 +2919,8 @@ nfe_stop(ifp); /* nfe_reset(sc); */ NFE_UNLOCK(sc); + + return (0); } @@ -3216,3 +3008,199 @@ return (sysctl_int_range(oidp, arg1, arg2, req, NFE_PROC_MIN, NFE_PROC_MAX)); } + + +#define NFE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) +#define NFE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) + +static void +nfe_sysctl_node(struct nfe_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct nfe_hw_stats *stats; + int error; + + stats = &sc->nfe_stats; + ctx = device_get_sysctl_ctx(sc->nfe_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->nfe_dev)); + SYSCTL_ADD_PROC(ctx, child, + OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, + &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", + "max number of Rx events to process"); + + sc->nfe_process_limit = NFE_PROC_DEFAULT; + error = resource_int_value(device_get_name(sc->nfe_dev), + device_get_unit(sc->nfe_dev), "process_limit", + &sc->nfe_process_limit); + if (error == 0) { + if (sc->nfe_process_limit < NFE_PROC_MIN || + sc->nfe_process_limit > NFE_PROC_MAX) { + device_printf(sc->nfe_dev, + "process_limit value out of range; " + "using default: %d\n", NFE_PROC_DEFAULT); + sc->nfe_process_limit = NFE_PROC_DEFAULT; + } + } + + if ((sc->nfe_flags & (NFE_MIB_V1 | NFE_MIB_V2 | NFE_MIB_V3)) == 0) + return; + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "NFE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + + NFE_SYSCTL_STAT_ADD32(ctx, child, "frame_errors", + &stats->rx_frame_errors, "Framing Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "extra_bytes", + &stats->rx_extra_bytes, "Extra Bytes"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "late_cols", + &stats->rx_late_cols, "Late Collisions"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Runts"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "jumbos", + &stats->rx_jumbos, "Jumbos"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fifo_overuns", + &stats->rx_fifo_overuns, "FIFO Overruns"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "crc_errors", + &stats->rx_crc_errors, "CRC Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fae", + &stats->rx_fae, "Frame Alignment Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "len_errors", + &stats->rx_len_errors, "Length Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "unicast", + &stats->rx_unicast, "Unicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multicast", + &stats->rx_multicast, "Multicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "brocadcast", + &stats->rx_broadcast, "Broadcast Frames"); + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", + &stats->rx_octets, "Octets"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "pause", + &stats->rx_pause, "Pause frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "drops", + &stats->rx_drops, "Drop frames"); + } + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", + &stats->tx_octets, "Octets"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "zero_rexmits", + &stats->tx_zero_rexmits, "Zero Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "one_rexmits", + &stats->tx_one_rexmits, "One Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multi_rexmits", + &stats->tx_multi_rexmits, "Multiple Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "late_cols", + &stats->tx_late_cols, "Late Collisions"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fifo_underuns", + &stats->tx_fifo_underuns, "FIFO Underruns"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "carrier_losts", + &stats->tx_carrier_losts, "Carrier Losts"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "excess_deferrals", + &stats->tx_excess_deferals, "Excess Deferrals"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "retry_errors", + &stats->tx_retry_errors, "Retry Errors"); + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + NFE_SYSCTL_STAT_ADD32(ctx, child, "deferrals", + &stats->tx_deferals, "Deferrals"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "frames", + &stats->tx_frames, "Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "pause", + &stats->tx_pause, "Pause Frames"); + } + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + NFE_SYSCTL_STAT_ADD32(ctx, child, "unicast", + &stats->tx_deferals, "Unicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multicast", + &stats->tx_frames, "Multicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "broadcast", + &stats->tx_pause, "Broadcast Frames"); + } +} + +#undef NFE_SYSCTL_STAT_ADD32 +#undef NFE_SYSCTL_STAT_ADD64 + +static void +nfe_stats_clear(struct nfe_softc *sc) +{ + int i, mib_cnt; + + if ((sc->nfe_flags & NFE_MIB_V1) != 0) + mib_cnt = NFE_NUM_MIB_STATV1; + else if ((sc->nfe_flags & (NFE_MIB_V2 | NFE_MIB_V3)) != 0) + mib_cnt = NFE_NUM_MIB_STATV2; + else + return; + + for (i = 0; i < mib_cnt; i += sizeof(uint32_t)) + NFE_READ(sc, NFE_TX_OCTET + i); + + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + NFE_READ(sc, NFE_TX_UNICAST); + NFE_READ(sc, NFE_TX_MULTICAST); + NFE_READ(sc, NFE_TX_BROADCAST); + } +} + +static void +nfe_stats_update(struct nfe_softc *sc) +{ + struct nfe_hw_stats *stats; + + NFE_LOCK_ASSERT(sc); + + if ((sc->nfe_flags & (NFE_MIB_V1 | NFE_MIB_V2 | NFE_MIB_V3)) == 0) + return; + + stats = &sc->nfe_stats; + stats->tx_octets += NFE_READ(sc, NFE_TX_OCTET); + stats->tx_zero_rexmits += NFE_READ(sc, NFE_TX_ZERO_REXMIT); + stats->tx_one_rexmits += NFE_READ(sc, NFE_TX_ONE_REXMIT); + stats->tx_multi_rexmits += NFE_READ(sc, NFE_TX_MULTI_REXMIT); + stats->tx_late_cols += NFE_READ(sc, NFE_TX_LATE_COL); + stats->tx_fifo_underuns += NFE_READ(sc, NFE_TX_FIFO_UNDERUN); + stats->tx_carrier_losts += NFE_READ(sc, NFE_TX_CARRIER_LOST); + stats->tx_excess_deferals += NFE_READ(sc, NFE_TX_EXCESS_DEFERRAL); + stats->tx_retry_errors += NFE_READ(sc, NFE_TX_RETRY_ERROR); + stats->rx_frame_errors += NFE_READ(sc, NFE_RX_FRAME_ERROR); + stats->rx_extra_bytes += NFE_READ(sc, NFE_RX_EXTRA_BYTES); + stats->rx_late_cols += NFE_READ(sc, NFE_RX_LATE_COL); + stats->rx_runts += NFE_READ(sc, NFE_RX_RUNT); + stats->rx_jumbos += NFE_READ(sc, NFE_RX_JUMBO); + stats->rx_fifo_overuns += NFE_READ(sc, NFE_RX_FIFO_OVERUN); + stats->rx_crc_errors += NFE_READ(sc, NFE_RX_CRC_ERROR); + stats->rx_fae += NFE_READ(sc, NFE_RX_FAE); + stats->rx_len_errors += NFE_READ(sc, NFE_RX_LEN_ERROR); + stats->rx_unicast += NFE_READ(sc, NFE_RX_UNICAST); + stats->rx_multicast += NFE_READ(sc, NFE_RX_MULTICAST); + stats->rx_broadcast += NFE_READ(sc, NFE_RX_BROADCAST); + + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + stats->tx_deferals += NFE_READ(sc, NFE_TX_DEFERAL); + stats->tx_frames += NFE_READ(sc, NFE_TX_FRAME); + stats->rx_octets += NFE_READ(sc, NFE_RX_OCTET); + stats->tx_pause += NFE_READ(sc, NFE_TX_PAUSE); + stats->rx_pause += NFE_READ(sc, NFE_RX_PAUSE); + stats->rx_drops += NFE_READ(sc, NFE_RX_DROP); + } + + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + stats->tx_unicast += NFE_READ(sc, NFE_TX_UNICAST); + stats->tx_multicast += NFE_READ(sc, NFE_TX_MULTICAST); + stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); + } +} Modified: haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfereg.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfereg.h 2008-12-02 17:51:42 UTC (rev 28760) +++ haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfereg.h 2008-12-02 17:52:30 UTC (rev 28761) @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.10 2007/06/12 10:51:47 yongari Exp $ + * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.14 2008/10/03 03:58:16 yongari Exp $ */ #define NFE_RX_RING_COUNT 256 @@ -39,16 +39,7 @@ #define NFE_JUMBO_MTU \ (NFE_JUMBO_FRAMELEN - NFE_RX_HEADERS) #define NFE_MIN_FRAMELEN (ETHER_MIN_LEN - ETHER_CRC_LEN) -#define NFE_JSLOTS ((NFE_JUMBO_RX_RING_COUNT * 3) / 2) -#define NFE_JRAWLEN (NFE_JUMBO_FRAMELEN + ETHER_ALIGN) -#define NFE_JLEN \ - (NFE_JRAWLEN + (sizeof(uint64_t) - (NFE_JRAWLEN % sizeof(uint64_t)))) -#define NFE_JPAGESZ PAGE_SIZE -#define NFE_RESID \ - (NFE_JPAGESZ - (NFE_JLEN * NFE_JSLOTS) % NFE_JPAGESZ) -#define NFE_JMEM ((NFE_JLEN * NFE_JSLOTS) + NFE_RESID) - #define NFE_MAX_SCATTER 32 #define NFE_TSO_MAXSGSIZE 4096 #define NFE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) @@ -96,11 +87,41 @@ #define NFE_PHY_SPEED 0x18c #define NFE_PHY_CTL 0x190 #define NFE_PHY_DATA 0x194 +#define NFE_TX_UNICAST 0x1a0 +#define NFE_TX_MULTICAST 0x1a4 +#define NFE_TX_BROADCAST 0x1a8 #define NFE_WOL_CTL 0x200 #define NFE_PATTERN_CRC 0x204 #define NFE_PATTERN_MASK 0x208 #define NFE_PWR_CAP 0x268 #define NFE_PWR_STATE 0x26c +#define NFE_TX_OCTET 0x280 +#define NFE_TX_ZERO_REXMIT 0x284 +#define NFE_TX_ONE_REXMIT 0x288 +#define NFE_TX_MULTI_REXMIT 0x28c +#define NFE_TX_LATE_COL 0x290 +#define NFE_TX_FIFO_UNDERUN 0x294 +#define NFE_TX_CARRIER_LOST 0x298 +#define NFE_TX_EXCESS_DEFERRAL 0x29c +#define NFE_TX_RETRY_ERROR 0x2a0 +#define NFE_RX_FRAME_ERROR 0x2a4 +#define NFE_RX_EXTRA_BYTES 0x2a8 +#define NFE_RX_LATE_COL 0x2ac +#define NFE_RX_RUNT 0x2b0 +#define NFE_RX_JUMBO 0x2b4 +#define NFE_RX_FIFO_OVERUN 0x2b8 +#define NFE_RX_CRC_ERROR 0x2bc +#define NFE_RX_FAE 0x2c0 +#define NFE_RX_LEN_ERROR 0x2c4 +#define NFE_RX_UNICAST 0x2c8 +#define NFE_RX_MULTICAST 0x2cc +#define NFE_RX_BROADCAST 0x2d0 +#define NFE_TX_DEFERAL 0x2d4 +#define NFE_TX_FRAME 0x2d8 +#define NFE_RX_OCTET 0x2dc +#define NFE_TX_PAUSE 0x2e0 +#define NFE_RX_PAUSE 0x2e4 +#define NFE_RX_DROP 0x2e8 #define NFE_VTAG_CTL 0x300 #define NFE_MSIX_MAP0 0x3e0 #define NFE_MSIX_MAP1 0x3e4 @@ -191,6 +212,10 @@ #define NFE_SEED_100TX 0x00002d00 #define NFE_SEED_1000T 0x00007400 +#define NFE_NUM_MIB_STATV1 21 +#define NFE_NUM_MIB_STATV2 27 +#define NFE_NUM_MIB_STATV3 30 + #define NFE_MSI_MESSAGES 8 #define NFE_MSI_VECTOR_0_ENABLED 0x01 @@ -300,6 +325,18 @@ #define PCI_PRODUCT_NVIDIA_MCP67_LAN2 0x054d #define PCI_PRODUCT_NVIDIA_MCP67_LAN3 0x054e #define PCI_PRODUCT_NVIDIA_MCP67_LAN4 0x054f +#define PCI_PRODUCT_NVIDIA_MCP73_LAN1 0x07dc +#define PCI_PRODUCT_NVIDIA_MCP73_LAN2 0x07dd +#define PCI_PRODUCT_NVIDIA_MCP73_LAN3 0x07de +#define PCI_PRODUCT_NVIDIA_MCP73_LAN4 0x07df +#define PCI_PRODUCT_NVIDIA_MCP77_LAN1 0x0760 +#define PCI_PRODUCT_NVIDIA_MCP77_LAN2 0x0761 +#define PCI_PRODUCT_NVIDIA_MCP77_LAN3 0x0762 +#define PCI_PRODUCT_NVIDIA_MCP77_LAN4 0x0763 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN1 0x0ab0 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN2 0x0ab1 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN3 0x0ab2 +#define PCI_PRODUCT_NVIDIA_MCP79_LAN4 0x0ab3 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2 Modified: haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfevar.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfevar.h 2008-12-02 17:51:42 UTC (rev 28760) +++ haiku/trunk/src/add-ons/kernel/drivers/network/nforce/dev/nfe/if_nfevar.h 2008-12-02 17:52:30 UTC (rev 28761) @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/nfe/if_nfevar.h,v 1.5 2007/07/24 01:11:00 yongari Exp $ + * $FreeBSD: src/sys/dev/nfe/if_nfevar.h,v 1.7 2008/10/03 03:58:16 yongari Exp $ */ struct nfe_tx_data { @@ -36,11 +36,6 @@ int next; }; -struct nfe_jpool_entry { - int slot; - SLIST_ENTRY(nfe_jpool_entry) jpool_entries; -}; - struct nfe_rx_data { bus_dmamap_t rx_data_map; bus_addr_t paddr; @@ -65,8 +60,6 @@ bus_dmamap_t jrx_desc_map; bus_dma_tag_t jrx_jumbo_tag; bus_dmamap_t jrx_jumbo_map; - void *jpool; - caddr_t jslots[NFE_JSLOTS]; bus_addr_t jphysaddr; struct nfe_desc32 *jdesc32; struct nfe_desc64 *jdesc64; @@ -77,6 +70,39 @@ int jnext; }; +struct nfe_hw_stats { + uint64_t rx_octets; + uint32_t rx_frame_errors; + uint32_t rx_extra_bytes; + uint32_t rx_late_cols; + uint32_t rx_runts; + uint32_t rx_jumbos; + uint32_t rx_fifo_overuns; + uint32_t rx_crc_errors; + uint32_t rx_fae; + uint32_t rx_len_errors; + uint32_t rx_unicast; + uint32_t rx_multicast; [... truncated: 49 lines follow ...] From anevilyak at mail.berlios.de Wed Dec 3 00:05:07 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 3 Dec 2008 00:05:07 +0100 Subject: [Haiku-commits] r28762 - haiku/trunk/src/kits/tracker Message-ID: <200812022305.mB2N57v7026476@sheep.berlios.de> Author: anevilyak Date: 2008-12-03 00:05:06 +0100 (Wed, 03 Dec 2008) New Revision: 28762 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28762&view=rev Modified: haiku/trunk/src/kits/tracker/FSUtils.cpp Log: Correctly indicate "Copying" vs "Moving" state in status window (thanks Adrian Panasiuk for pointing this out). Modified: haiku/trunk/src/kits/tracker/FSUtils.cpp =================================================================== --- haiku/trunk/src/kits/tracker/FSUtils.cpp 2008-12-02 17:52:30 UTC (rev 28761) +++ haiku/trunk/src/kits/tracker/FSUtils.cpp 2008-12-02 23:05:06 UTC (rev 28762) @@ -591,7 +591,8 @@ case kMoveSelectionTo: { if (gStatusWindow) - gStatusWindow->CreateStatusItem(thread, kCopyState); + gStatusWindow->CreateStatusItem(thread, + moveMode == kMoveSelectionTo ? kMoveState : kCopyState); int32 totalItems = 0; off_t totalSize = 0; @@ -616,9 +617,7 @@ // this will be fast, only put up status if lots of items // moved, links created if (gStatusWindow) { - gStatusWindow->CreateStatusItem(thread, - moveMode == kMoveSelectionTo - ? kMoveState : kCreateLinkState); + gStatusWindow->CreateStatusItem(thread, kCreateLinkState); gStatusWindow->InitStatusItem(thread, numItems, numItems, destRef); } From colacoder at mail.berlios.de Wed Dec 3 00:42:16 2008 From: colacoder at mail.berlios.de (colacoder at mail.berlios.de) Date: Wed, 3 Dec 2008 00:42:16 +0100 Subject: [Haiku-commits] r28763 - haiku/trunk/src/bin/iasl Message-ID: <200812022342.mB2NgG8P013941@sheep.berlios.de> Author: colacoder Date: 2008-12-03 00:42:13 +0100 (Wed, 03 Dec 2008) New Revision: 28763 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28763&view=rev Modified: haiku/trunk/src/bin/iasl/Jamfile haiku/trunk/src/bin/iasl/osunixxf.c Log: Update iasl bin tool to acpica-20080701 Modified: haiku/trunk/src/bin/iasl/Jamfile =================================================================== --- haiku/trunk/src/bin/iasl/Jamfile 2008-12-02 23:05:06 UTC (rev 28762) +++ haiku/trunk/src/bin/iasl/Jamfile 2008-12-02 23:42:13 UTC (rev 28763) @@ -13,7 +13,7 @@ aslcompiler.l aslcompiler.y.y aslanalyze.c aslcodegen.c - aslcompile.c aslerror.c aslfiles.c asllength.c + aslcompile.c aslerror.c aslfiles.c asllength.c aslstartup.c asllisting.c aslload.c asllookup.c aslmain.c aslmap.c aslopcodes.c asloperands.c aslresource.c aslrestype1.c aslrestype2.c asltree.c aslutils.c asltransform.c aslfold.c aslstubs.c aslopt.c @@ -43,7 +43,7 @@ ; local utilities_src = - utalloc.c utcache.c utcopy.c utdebug.c utdelete.c utglobal.c utobject.c utmisc.c utmath.c utmutex.c utresrc.c utstate.c + utalloc.c utcache.c utcopy.c utdebug.c utdelete.c utglobal.c utobject.c utmisc.c utmath.c utmutex.c utresrc.c utstate.c utxface.c utinit.c ; local namespace_src = @@ -82,9 +82,9 @@ SEARCH on [ FGristFiles $(common_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi common ] ; SEARCH on [ FGristFiles $(utilities_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi utilities ] ; SEARCH on [ FGristFiles $(namespace_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi namespace ] ; -SEARCH on [ FGristFiles $(parser_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi interpreter parser ] ; -SEARCH on [ FGristFiles $(dispatcher_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi interpreter dispatcher ] ; -SEARCH on [ FGristFiles $(executer_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi interpreter executer ] ; +SEARCH on [ FGristFiles $(parser_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi parser ] ; +SEARCH on [ FGristFiles $(dispatcher_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi dispatcher ] ; +SEARCH on [ FGristFiles $(executer_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi executer ] ; SEARCH on [ FGristFiles $(tables_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi tables ] ; SEARCH on [ FGristFiles dbfileio.c ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi debugger ] ; Modified: haiku/trunk/src/bin/iasl/osunixxf.c =================================================================== --- haiku/trunk/src/bin/iasl/osunixxf.c 2008-12-02 23:05:06 UTC (rev 28762) +++ haiku/trunk/src/bin/iasl/osunixxf.c 2008-12-02 23:42:13 UTC (rev 28763) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp. * All rights reserved. * * 2. License @@ -471,7 +471,7 @@ ACPI_SIZE length) { - return (ACPI_TO_POINTER ((ACPI_NATIVE_UINT) where)); + return (ACPI_TO_POINTER ((ACPI_SIZE) where)); } From colacoder at mail.berlios.de Wed Dec 3 00:43:52 2008 From: colacoder at mail.berlios.de (colacoder at mail.berlios.de) Date: Wed, 3 Dec 2008 00:43:52 +0100 Subject: [Haiku-commits] r28764 - haiku/trunk/src/add-ons/kernel/drivers/power Message-ID: <200812022343.mB2NhqxA014570@sheep.berlios.de> Author: colacoder Date: 2008-12-03 00:43:50 +0100 (Wed, 03 Dec 2008) New Revision: 28764 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28764&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/power/Jamfile Log: add the acpi_lid driver to the build system; not in the image yet though... Modified: haiku/trunk/src/add-ons/kernel/drivers/power/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/power/Jamfile 2008-12-02 23:42:13 UTC (rev 28763) +++ haiku/trunk/src/add-ons/kernel/drivers/power/Jamfile 2008-12-02 23:43:50 UTC (rev 28764) @@ -1,4 +1,5 @@ SubDir HAIKU_TOP src add-ons kernel drivers power ; SubInclude HAIKU_TOP src add-ons kernel drivers power acpi_button ; +SubInclude HAIKU_TOP src add-ons kernel drivers power acpi_lid ; SubInclude HAIKU_TOP src add-ons kernel drivers power acpi_thermal ; From bonefish at mail.berlios.de Wed Dec 3 03:02:29 2008 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 3 Dec 2008 03:02:29 +0100 Subject: [Haiku-commits] r28765 - in haiku/trunk: . build/jam Message-ID: <200812030202.mB322T17006829@sheep.berlios.de> Author: bonefish Date: 2008-12-03 03:02:28 +0100 (Wed, 03 Dec 2008) New Revision: 28765 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28765&view=rev Modified: haiku/trunk/Jamrules haiku/trunk/build/jam/HaikuImage haiku/trunk/build/jam/UserBuildConfig.ReadMe Log: Introduced rules UserBuildConfigRulePostBuildTargets, UserBuildConfigRulePreImage, and UserBuildConfigRulePostImage which will be invoked at different points in the build system execution. They can be overridden in UserBuildConfig, thus allowing for executing user code at those points. Modified: haiku/trunk/Jamrules =================================================================== --- haiku/trunk/Jamrules 2008-12-02 23:43:50 UTC (rev 28764) +++ haiku/trunk/Jamrules 2008-12-03 02:02:28 UTC (rev 28765) @@ -45,6 +45,11 @@ include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ; +# Declare no-op user-overridable build rules. +rule UserBuildConfigRulePostBuildTargets { } +rule UserBuildConfigRulePreImage { } +rule UserBuildConfigRulePostImage { } + # Include UserBuildConfig. { local userBuildConfig Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2008-12-02 23:43:50 UTC (rev 28764) +++ haiku/trunk/build/jam/HaikuImage 2008-12-03 02:02:28 UTC (rev 28765) @@ -606,6 +606,9 @@ #pragma mark - Build The Image +# Execute pre-image user config rules. +UserBuildConfigRulePreImage ; + # Set image name and directory defaults and locate the image. HAIKU_IMAGE_NAME ?= $(HAIKU_DEFAULT_IMAGE_NAME) ; HAIKU_IMAGE_DIR ?= $(HAIKU_DEFAULT_IMAGE_DIR) ; @@ -716,3 +719,6 @@ _BuildHaikuImage $(HAIKU_VMWARE_IMAGE) : true : true ; NotFile haiku-vmware-image ; Depends haiku-vmware-image : $(HAIKU_VMWARE_IMAGE) ; + +# Execute post-image user config rules. +UserBuildConfigRulePostImage ; Modified: haiku/trunk/build/jam/UserBuildConfig.ReadMe =================================================================== --- haiku/trunk/build/jam/UserBuildConfig.ReadMe 2008-12-02 23:43:50 UTC (rev 28764) +++ haiku/trunk/build/jam/UserBuildConfig.ReadMe 2008-12-03 02:02:28 UTC (rev 28765) @@ -12,14 +12,6 @@ Exit You must NOT copy UserBuildConfig.ReadMe directly but use parts of it! ; -# Adding timezone and keymap settings -AddSymlinkToHaikuImage home config settings - : /boot/beos/etc/timezones/Europe/Paris : timezone ; - -AddFilesToHaikuImage home config settings : US-International - : Key_map ; - - # Adjusting Build Variables # The following variables can be configured per subdirectory (or subtree) or @@ -99,6 +91,11 @@ # Make a symlink to home/config/bin/crash. AddSymlinkToHaikuImage home config bin : /beos/bin/crashing_app : crash ; +# Add timezone and keymap settings. +AddSymlinkToHaikuImage home config settings + : /boot/beos/etc/timezones/Europe/Paris : timezone ; +AddFilesToHaikuImage home config settings : US-International : Key_map ; + # Adds the source directories src/kits/storage and src/tests/servers/debug # (recursively) to the image (as /boot/home/HaikuSources/src/kits/storage # and /boot/home/HaikuSources/src/tests/servers/debug respectively). @@ -284,3 +281,24 @@ # usual). Omitting this parameter or specifying "global" will cause the given # name to be used recursively. DeferredSubInclude HAIKU_TOP src 3rdparty myproject : Jamfile.haiku : local ; + +# The following rules can be overriden to do things at different points of +# the build system execution by jam (note: we're talking about execution of +# Jamfiles, not the build actions they define): +# +# UserBuildConfigRulePostBuildTargets: +# Executed after the complete Jamfile tree has been processed. I.e. all build +# targets are known and located at this point. +# UserBuildConfigRulePreImage: +# Executed after the contents of the Haiku image has been defined, but before +# the scripts generating the images are defined. +# UserBuildConfigRulePostImage: +# Executed after the Haiku image build target has been fully defined. +# +# E.g. making use of the fact that all targets have already been located when +# UserBuildConfigRulePostBuildTargets is called, we can print the directory +# where the StyledEdit executable will be generated. +rule UserBuildConfigRulePostBuildTargets +{ + Echo "StyledEdit will appear here:" [ on StyledEdit return $(LOCATE) ] ; +} From mmu_man at mail.berlios.de Wed Dec 3 03:38:27 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 3 Dec 2008 03:38:27 +0100 Subject: [Haiku-commits] r28766 - haiku/trunk/src/bin Message-ID: <200812030238.mB32cRcX008385@sheep.berlios.de> Author: mmu_man Date: 2008-12-03 03:38:26 +0100 (Wed, 03 Dec 2008) New Revision: 28766 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28766&view=rev Added: haiku/trunk/src/bin/spybmessage.cpp Log: YetAnotherUselessDebugToolIWrote Added: haiku/trunk/src/bin/spybmessage.cpp =================================================================== --- haiku/trunk/src/bin/spybmessage.cpp 2008-12-03 02:02:28 UTC (rev 28765) +++ haiku/trunk/src/bin/spybmessage.cpp 2008-12-03 02:38:26 UTC (rev 28766) @@ -0,0 +1,221 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern char **original_argv; +extern char **argv_save; +extern char **__libc_argv; +extern int original_argc; +extern int __libc_argc; + +#define MAX_VIEWS 10 + +int gStartWin = 0; +char *gMatchViewNames[MAX_VIEWS]; +int gNumViewNames = 0; + +char gExePath[B_PATH_NAME_LENGTH]; +image_id gExeImg = -1; +int (*gExeMainProc)(int argc, char **argv); + +thread_id gWaitForBAppThID = -1; +sem_id gStdoutLock; + +//extern "C" EnqueueMessage__Q28BPrivate13BLooperTargetP8BMessage(BLooper *_this, BMessage *message); + +//EnqueueMessage__Q28BPrivate13BLooperTargetP8BMessage(BLooper *_this, BMessage *message); + +BMessageFilter *gAppFilter; +bool quitting = false; + +filter_result bapp_filter(BMessage *message, + BHandler **target, + BMessageFilter *filter) +{ + if (message->what == 'plop') /* our doesn't count */ + return B_DISPATCH_MESSAGE; + acquire_sem(gStdoutLock); + fprintf(stdout, "\033[31mMessage for BApplication:\033[0m\n"); + message->PrintToStream(); + release_sem(gStdoutLock); + return B_DISPATCH_MESSAGE; +} + +filter_result bwin_filter(BMessage *message, + BHandler **target, + BMessageFilter *filter) +{ + BWindow *win; + BHandler *hand = NULL; + if (target) + hand = *target; + win = dynamic_cast(filter->Looper()); + acquire_sem(gStdoutLock); + fprintf(stdout, + "\033[31mMessage for View \"%s\" of Window \"%s\":\033[0m\n", + hand?hand->Name():NULL, + win?win->Title():NULL); + message->PrintToStream(); + release_sem(gStdoutLock); + return B_DISPATCH_MESSAGE; +} + +class MyHandler : public BHandler { +public: + MyHandler(); + ~MyHandler(); + void MessageReceived(BMessage *msg); +private: + BList fWindowList; +}; + +MyHandler::MyHandler() + :BHandler("spying handler") +{ + fWindowList.MakeEmpty(); +} + +MyHandler::~MyHandler() +{ +} + +void MyHandler::MessageReceived(BMessage *msg) +{ + int i; + BMessageFilter *afilter; + switch (msg->what) { + case 'plop': + i = be_app->CountWindows(); + for (; i; i--) { + BWindow *win = be_app->WindowAt(i-1); + if (win && !fWindowList.HasItem(win)) { + fWindowList.AddItem(win); + afilter = new BMessageFilter(B_ANY_DELIVERY, + B_ANY_SOURCE, + bwin_filter); + win->Lock(); + win->AddCommonFilter(afilter); + win->Unlock(); + } + } + break; + } + BHandler::MessageReceived(msg); +} + +int32 wait_for_loopers(void *arg) +{ + MyHandler *myh; + /* wait for BApplication */ + while (!be_app) + snooze(50000); + gAppFilter = new BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, bapp_filter); + myh = new MyHandler; + be_app->Lock(); + be_app->AddCommonFilter(gAppFilter); + be_app->AddHandler(myh); + be_app->Unlock(); + new BMessageRunner(BMessenger(myh), new BMessage('plop'), 100000); + + return 0; +} + +static int usage(char *argv0) +{ + printf("usage:\n"); + printf("%s app [args...]\n", argv0); + return 0; +} + +int main(int argc, char **argv) +{ + int i; + status_t err; + char *trapp_name; + if (argc < 2) + return usage(argv[0]); + trapp_name = argv[0]; + + for (i = 1; i < argc; i++) { + if (strncmp(argv[i], "-", 1)) + break; + else if (!strcmp(argv[i], "-view")) { + if (gNumViewNames >= MAX_VIEWS) { + printf("too many view names\n"); + return 1; + } + i++; + if (i >= argc) { + printf("missing arg to -view\n"); + return 1; + } + gMatchViewNames[gNumViewNames] = argv[i]; + gNumViewNames++; + } else if (!strcmp(argv[i], "-firstw")) { + i++; + if (i >= argc) { + printf("missing arg to -firstw\n"); + return 1; + } + gStartWin = atoi(argv[i]); + } else { + return usage(argv[0]); + } + } + if (argc - i < 1) + return usage(argv[0]); + argv += i; + argc -= i; + + for (i = 0; i < argc; i++) + printf("argv[%d] = %s\n", i, argv[i]); + gExePath[0] = '\0'; + if (strncmp(argv[0], "/", 1)) { + getcwd(gExePath, B_PATH_NAME_LENGTH-10); + strcat(gExePath, "/"); + } + strncat(gExePath, argv[0], B_PATH_NAME_LENGTH-1-strlen(gExePath)); + printf("cmd = %s\n", gExePath); + gExeImg = load_add_on(gExePath); + if (gExeImg < B_OK) { + fprintf(stderr, "load_add_on: %s\n", strerror(gExeImg)); + return 1; + } + + // original are static... + //printf("original: %d; %s\n", original_argc, *original_argv); + fprintf(stderr, "libc: %d; %s\n", __libc_argc, *__libc_argv); + fprintf(stderr, "save: %s\n", *argv_save); + + //argv[0] = trapp_name; + __libc_argv = argv; + __libc_argc = argc; + argv_save = argv; + + gStdoutLock = create_sem(1, "spybmsg_stdout_lock"); + + err = get_image_symbol(gExeImg, "main", B_SYMBOL_TYPE_TEXT, (void **)&gExeMainProc); + if (err < B_OK) { + fprintf(stderr, "get_image_symbol(main): %s\n", strerror(gExeImg)); + return 1; + } + printf("main @ %p\n", gExeMainProc); + + resume_thread(spawn_thread(wait_for_loopers, + "waiting for BLoopers", + B_NORMAL_PRIORITY, NULL)); + + i = gExeMainProc(argc, argv); + + return i; +} + From mmu_man at mail.berlios.de Wed Dec 3 03:46:40 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 3 Dec 2008 03:46:40 +0100 Subject: [Haiku-commits] r28767 - haiku/trunk/src/bin Message-ID: <200812030246.mB32keot008725@sheep.berlios.de> Author: mmu_man Date: 2008-12-03 03:46:39 +0100 (Wed, 03 Dec 2008) New Revision: 28767 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28767&view=rev Modified: haiku/trunk/src/bin/Jamfile Log: Add to build, wow it even builds without a single warning :) Modified: haiku/trunk/src/bin/Jamfile =================================================================== --- haiku/trunk/src/bin/Jamfile 2008-12-03 02:38:26 UTC (rev 28766) +++ haiku/trunk/src/bin/Jamfile 2008-12-03 02:46:39 UTC (rev 28767) @@ -100,6 +100,7 @@ setdecor.cpp settype.cpp setversion.cpp + spybmessage.cpp urlwrapper.cpp version.cpp WindowShade.cpp From anevilyak at mail.berlios.de Wed Dec 3 03:46:59 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 3 Dec 2008 03:46:59 +0100 Subject: [Haiku-commits] r28768 - haiku/trunk/build/jam Message-ID: <200812030246.mB32kxWx008754@sheep.berlios.de> Author: anevilyak Date: 2008-12-03 03:46:59 +0100 (Wed, 03 Dec 2008) New Revision: 28768 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28768&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Updated CVS and yasm packages, thanks to Scott McCreary for the updates! Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2008-12-03 02:46:39 UTC (rev 28767) +++ haiku/trunk/build/jam/OptionalPackages 2008-12-03 02:46:59 UTC (rev 28768) @@ -164,8 +164,8 @@ Echo "No optional package CVS available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; - InstallOptionalHaikuImagePackage cvs-1.12.13-gcc2-2008-09-30 - : $(baseURL)/cvs-1.12.13-gcc2-2008-09-30.zip + InstallOptionalHaikuImagePackage cvs-1.12.13-gcc2-2008-11-29 + : $(baseURL)/cvs-1.12.13-gcc2-2008-11-29.zip : ; } @@ -510,8 +510,8 @@ Echo "No optional package Yasm available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; - InstallOptionalHaikuImagePackage yasm-0.7.1-gcc2-2008-10-01 - : $(baseURL)/yasm-0.7.1-gcc2-2008-10-01.zip + InstallOptionalHaikuImagePackage yasm-0.7.2-gcc2-2008-11-25 + : $(baseURL)/yasm-0.7.2-gcc2-2008-11-25.zip : ; } From anevilyak at mail.berlios.de Wed Dec 3 15:43:23 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 3 Dec 2008 15:43:23 +0100 Subject: [Haiku-commits] r28769 - haiku/trunk/src/kits/tracker Message-ID: <200812031443.mB3EhN6g008660@sheep.berlios.de> Author: anevilyak Date: 2008-12-03 15:43:23 +0100 (Wed, 03 Dec 2008) New Revision: 28769 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28769&view=rev Modified: haiku/trunk/src/kits/tracker/FSUtils.cpp Log: If the source volume is read only, only allow a copy op since move makes no sense in this case. Ideally we should probably also modify NavMenu and the drag context menu to only present the options that make sense in a particular situation. Fixes ticket #3195. Modified: haiku/trunk/src/kits/tracker/FSUtils.cpp =================================================================== --- haiku/trunk/src/kits/tracker/FSUtils.cpp 2008-12-03 02:46:59 UTC (rev 28768) +++ haiku/trunk/src/kits/tracker/FSUtils.cpp 2008-12-03 14:43:23 UTC (rev 28769) @@ -658,7 +658,7 @@ dev_t destVolumeDevice = srcVolumeDevice; StatStruct deststat; - BVolume volume; + BVolume volume (srcVolumeDevice); entry_ref destRef; const entry_ref *destRefToCheck = NULL; @@ -666,7 +666,9 @@ BDirectory destDir; BDirectory *destDirToCheck = NULL; bool needPreflightNameCheck = false; - + bool sourceIsReadOnly = volume.IsReadOnly(); + volume.Unset(); + bool fromUndo = FSIsUndoMoveMode(moveMode); moveMode = FSMoveMode(moveMode); @@ -705,6 +707,9 @@ if (moveMode == kCopySelectionTo && destIsTrash) // cannot copy to trash moveMode = kMoveSelectionTo; + + if (moveMode == kMoveSelectionTo && sourceIsReadOnly) + moveMode = kCopySelectionTo; // we need the undo object later on, so we create it no matter // if we really need it or not (it's very lightweight) From colacoder at mail.berlios.de Wed Dec 3 21:05:21 2008 From: colacoder at mail.berlios.de (colacoder at mail.berlios.de) Date: Wed, 3 Dec 2008 21:05:21 +0100 Subject: [Haiku-commits] r28770 - in haiku/trunk/src/libs/compat/freebsd_network/compat: machine net sys Message-ID: <200812032005.mB3K5L3R023382@sheep.berlios.de> Author: colacoder Date: 2008-12-03 21:05:20 +0100 (Wed, 03 Dec 2008) New Revision: 28770 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28770&view=rev Added: haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_llc.h Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/machine/atomic.h haiku/trunk/src/libs/compat/freebsd_network/compat/sys/param.h Log: Add if_llc.h to BSD compatibility layer; remove a semicolon from a macro definition where it shouldn't be; and add the roundup() macro. Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/machine/atomic.h =================================================================== --- haiku/trunk/src/libs/compat/freebsd_network/compat/machine/atomic.h 2008-12-03 14:43:23 UTC (rev 28769) +++ haiku/trunk/src/libs/compat/freebsd_network/compat/machine/atomic.h 2008-12-03 20:05:20 UTC (rev 28770) @@ -19,6 +19,9 @@ atomic_set_int(ptr, value) #define atomic_set_int(ptr, value) \ - atomic_or((int32 *)(ptr), value); + atomic_or((int32 *)(ptr), value) +#define atomic_readandclear_int(ptr) \ + atomic_set((int32 *)(ptr), 0) + #endif /* _FBSD_COMPAT_MACHINE_ATOMIC_H_ */ Added: haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_llc.h =================================================================== --- haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_llc.h 2008-12-03 14:43:23 UTC (rev 28769) +++ haiku/trunk/src/libs/compat/freebsd_network/compat/net/if_llc.h 2008-12-03 20:05:20 UTC (rev 28770) @@ -0,0 +1,161 @@ +/* $NetBSD: if_llc.h,v 1.12 1999/11/19 20:41:19 thorpej Exp $ */ + +/*- + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)if_llc.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/net/if_llc.h,v 1.13 2006/12/01 17:50:11 imp Exp $ + */ + +#ifndef _NET_IF_LLC_H_ +#define _NET_IF_LLC_H_ + +/* + * IEEE 802.2 Link Level Control headers, for use in conjunction with + * 802.{3,4,5} media access control methods. + * + * Headers here do not use bit fields due to shortcommings in many + * compilers. + */ + +struct llc { + u_int8_t llc_dsap; + u_int8_t llc_ssap; + union { + struct { + u_int8_t control; + u_int8_t format_id; + u_int8_t class; + u_int8_t window_x2; + } __packed type_u; + struct { + u_int8_t num_snd_x2; + u_int8_t num_rcv_x2; + } __packed type_i; + struct { + u_int8_t control; + u_int8_t num_rcv_x2; + } __packed type_s; + struct { + u_int8_t control; + /* + * We cannot put the following fields in a structure because + * the structure rounding might cause padding. + */ + u_int8_t frmr_rej_pdu0; + u_int8_t frmr_rej_pdu1; + u_int8_t frmr_control; + u_int8_t frmr_control_ext; + u_int8_t frmr_cause; + } __packed type_frmr; + struct { + u_int8_t control; + u_int8_t org_code[3]; + u_int16_t ether_type; + } __packed type_snap; + struct { + u_int8_t control; + u_int8_t control_ext; + } __packed type_raw; + } __packed llc_un; +} __packed; + +struct frmrinfo { + u_int8_t frmr_rej_pdu0; + u_int8_t frmr_rej_pdu1; + u_int8_t frmr_control; + u_int8_t frmr_control_ext; + u_int8_t frmr_cause; +} __packed; + +#define llc_control llc_un.type_u.control +#define llc_control_ext llc_un.type_raw.control_ext +#define llc_fid llc_un.type_u.format_id +#define llc_class llc_un.type_u.class +#define llc_window llc_un.type_u.window_x2 +#define llc_frmrinfo llc_un.type_frmr.frmr_rej_pdu0 +#define llc_frmr_pdu0 llc_un.type_frmr.frmr_rej_pdu0 +#define llc_frmr_pdu1 llc_un.type_frmr.frmr_rej_pdu1 +#define llc_frmr_control llc_un.type_frmr.frmr_control +#define llc_frmr_control_ext llc_un.type_frmr.frmr_control_ext +#define llc_frmr_cause llc_un.type_frmr.frmr_cause +#define llc_snap llc_un.type_snap + +/* + * Don't use sizeof(struct llc_un) for LLC header sizes + */ +#define LLC_ISFRAMELEN 4 +#define LLC_UFRAMELEN 3 +#define LLC_FRMRLEN 7 +#define LLC_SNAPFRAMELEN 8 + +#ifdef CTASSERT +CTASSERT(sizeof (struct llc) == LLC_SNAPFRAMELEN); +#endif + +/* + * Unnumbered LLC format commands + */ +#define LLC_UI 0x3 +#define LLC_UI_P 0x13 +#define LLC_DISC 0x43 +#define LLC_DISC_P 0x53 +#define LLC_UA 0x63 +#define LLC_UA_P 0x73 +#define LLC_TEST 0xe3 +#define LLC_TEST_P 0xf3 +#define LLC_FRMR 0x87 +#define LLC_FRMR_P 0x97 +#define LLC_DM 0x0f +#define LLC_DM_P 0x1f +#define LLC_XID 0xaf +#define LLC_XID_P 0xbf +#define LLC_SABME 0x6f +#define LLC_SABME_P 0x7f + +/* + * Supervisory LLC commands + */ +#define LLC_RR 0x01 +#define LLC_RNR 0x05 +#define LLC_REJ 0x09 + +/* + * Info format - dummy only + */ +#define LLC_INFO 0x00 + +/* + * ISO PDTR 10178 contains among others + */ +#define LLC_8021D_LSAP 0x42 +#define LLC_X25_LSAP 0x7e +#define LLC_SNAP_LSAP 0xaa +#define LLC_ISO_LSAP 0xfe + +#endif /* _NET_IF_LLC_H_ */ Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/sys/param.h =================================================================== --- haiku/trunk/src/libs/compat/freebsd_network/compat/sys/param.h 2008-12-03 14:43:23 UTC (rev 28769) +++ haiku/trunk/src/libs/compat/freebsd_network/compat/sys/param.h 2008-12-03 20:05:20 UTC (rev 28770) @@ -46,6 +46,7 @@ #define ALIGN_BYTES (sizeof(int) - 1) #define ALIGN(x) ((((unsigned)x) + ALIGN_BYTES) & ~ALIGN_BYTES) +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x) + ((y) - 1)) & (~((y) - 1))) #define rounddown(x, y) (((x) / (y)) * (y)) From colacoder at mail.berlios.de Wed Dec 3 21:10:51 2008 From: colacoder at mail.berlios.de (colacoder at mail.berlios.de) Date: Wed, 3 Dec 2008 21:10:51 +0100 Subject: [Haiku-commits] r28771 - in haiku/trunk/src/add-ons/kernel/drivers/network: . ar81xx ar81xx/dev ar81xx/dev/ale ar81xx/dev/mii Message-ID: <200812032010.mB3KApr9023911@sheep.berlios.de> Author: colacoder Date: 2008-12-03 21:10:48 +0100 (Wed, 03 Dec 2008) New Revision: 28771 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28771&view=rev Added: haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/Jamfile haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/Jamfile haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/Jamfile haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/glue.c haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_alereg.h haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_alevar.h haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/Jamfile haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/ukphy.c haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/ukphy_subr.c Modified: haiku/trunk/src/add-ons/kernel/drivers/network/Jamfile Log: Add network driver for Atheros AR8121/AR8113/AR8114 controllers to the build. These are used in the EeePC 901 and later. Modified: haiku/trunk/src/add-ons/kernel/drivers/network/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/Jamfile 2008-12-03 20:05:20 UTC (rev 28770) +++ haiku/trunk/src/add-ons/kernel/drivers/network/Jamfile 2008-12-03 20:10:48 UTC (rev 28771) @@ -24,6 +24,7 @@ SubInclude HAIKU_TOP src add-ons kernel drivers network pcnet ; SubInclude HAIKU_TOP src add-ons kernel drivers network syskonnect ; SubInclude HAIKU_TOP src add-ons kernel drivers network attansic_l2 ; +SubInclude HAIKU_TOP src add-ons kernel drivers network ar81xx ; SubInclude HAIKU_TOP src add-ons kernel drivers network rtl81xx ; SubIncludeGPL HAIKU_TOP src add-ons kernel drivers network bcm440x ; Added: haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/Jamfile 2008-12-03 20:05:20 UTC (rev 28770) +++ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/Jamfile 2008-12-03 20:10:48 UTC (rev 28771) @@ -0,0 +1,3 @@ +SubDir HAIKU_TOP src add-ons kernel drivers network ar81xx ; + +SubInclude HAIKU_TOP src add-ons kernel drivers network ar81xx dev ; Added: haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/Jamfile 2008-12-03 20:05:20 UTC (rev 28770) +++ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/Jamfile 2008-12-03 20:10:48 UTC (rev 28771) @@ -0,0 +1,5 @@ +SubDir HAIKU_TOP src add-ons kernel drivers network ar81xx dev ; + +SubInclude HAIKU_TOP src add-ons kernel drivers network ar81xx dev mii ; +SubInclude HAIKU_TOP src add-ons kernel drivers network ar81xx dev ale ; + Added: haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/Jamfile 2008-12-03 20:05:20 UTC (rev 28770) +++ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/Jamfile 2008-12-03 20:10:48 UTC (rev 28771) @@ -0,0 +1,14 @@ +SubDir HAIKU_TOP src add-ons kernel drivers network ar81xx dev ale ; + +UsePrivateHeaders kernel net ; + +UseHeaders [ FDirName $(SUBDIR) .. .. ] : true ; +UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ] : true ; + +SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ] ; + +KernelAddon ar81xx : + if_ale.c + glue.c + : libfreebsd_network.a ar81xx_mii.a + ; Added: haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/glue.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/glue.c 2008-12-03 20:05:20 UTC (rev 28770) +++ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/glue.c 2008-12-03 20:10:48 UTC (rev 28771) @@ -0,0 +1,29 @@ +/* + * Copyright 2007, Hugo Santos. All Rights Reserved. + * Copyright 2007, Axel D?rfler, axeld at pinc-software.de. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ + + +#include + + +HAIKU_FBSD_DRIVER_GLUE(ar81xx, ale, pci) + +extern driver_t *DRIVER_MODULE_NAME(ukphy, miibus); + +driver_t * +__haiku_select_miibus_driver(device_t dev) +{ + driver_t *drivers[] = { + DRIVER_MODULE_NAME(ukphy, miibus), + NULL + }; + + return __haiku_probe_miibus(dev, drivers); +} + +NO_HAIKU_CHECK_DISABLE_INTERRUPTS(); +NO_HAIKU_REENABLE_INTERRUPTS(); + +HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_FAST_TASKQUEUE | FBSD_SWI_TASKQUEUE); Added: haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c 2008-12-03 20:05:20 UTC (rev 28770) +++ haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c 2008-12-03 20:10:48 UTC (rev 28771) @@ -0,0 +1,3112 @@ +/*- + * Copyright (c) 2008, Pyun YongHyeon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */ + +#include +__FBSDID("$FreeBSD: src/sys/dev/ale/if_ale.c,v 1.3 2008/12/03 09:01:12 yongari Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +/* "device miibus" required. See GENERIC if you get errors here. */ +#include "miibus_if.h" + +/* For more information about Tx checksum offload issues see ale_encap(). */ +#define ALE_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) +#ifndef IFCAP_VLAN_HWTSO +#define IFCAP_VLAN_HWTSO 0 +#endif + +MODULE_DEPEND(ale, pci, 1, 1, 1); +MODULE_DEPEND(ale, ether, 1, 1, 1); +MODULE_DEPEND(ale, miibus, 1, 1, 1); + +/* Tunables. */ +static int msi_disable = 0; +static int msix_disable = 0; +TUNABLE_INT("hw.ale.msi_disable", &msi_disable); +TUNABLE_INT("hw.ale.msix_disable", &msix_disable); + +/* + * Devices supported by this driver. + */ +static struct ale_dev { + uint16_t ale_vendorid; + uint16_t ale_deviceid; + const char *ale_name; +} ale_devs[] = { + { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR81XX, + "Atheros AR8121/AR8113/AR8114 PCIe Ethernet" }, +}; + +static int ale_attach(device_t); +static int ale_check_boundary(struct ale_softc *); +static int ale_detach(device_t); +static int ale_dma_alloc(struct ale_softc *); +static void ale_dma_free(struct ale_softc *); +static void ale_dmamap_cb(void *, bus_dma_segment_t *, int, int); +static int ale_encap(struct ale_softc *, struct mbuf **); +static void ale_get_macaddr(struct ale_softc *); +static void ale_init(void *); +static void ale_init_locked(struct ale_softc *); +static void ale_init_rx_pages(struct ale_softc *); +static void ale_init_tx_ring(struct ale_softc *); +static void ale_int_task(void *, int); +static int ale_intr(void *); +static int ale_ioctl(struct ifnet *, u_long, caddr_t); +static void ale_link_task(void *, int); +static void ale_mac_config(struct ale_softc *); +static int ale_miibus_readreg(device_t, int, int); +static void ale_miibus_statchg(device_t); +static int ale_miibus_writereg(device_t, int, int, int); +static int ale_mediachange(struct ifnet *); +static void ale_mediastatus(struct ifnet *, struct ifmediareq *); +static void ale_phy_reset(struct ale_softc *); +static int ale_probe(device_t); +static void ale_reset(struct ale_softc *); +static int ale_resume(device_t); +static void ale_rx_update_page(struct ale_softc *, struct ale_rx_page **, + uint32_t, uint32_t *); +static void ale_rxcsum(struct ale_softc *, struct mbuf *, uint32_t); +static int ale_rxeof(struct ale_softc *sc, int); +static void ale_rxfilter(struct ale_softc *); +static void ale_rxvlan(struct ale_softc *); +static void ale_setlinkspeed(struct ale_softc *); +static void ale_setwol(struct ale_softc *); +static int ale_shutdown(device_t); +static void ale_start(struct ifnet *); +static void ale_stats_clear(struct ale_softc *); +static void ale_stats_update(struct ale_softc *); +static void ale_stop(struct ale_softc *); +static void ale_stop_mac(struct ale_softc *); +static int ale_suspend(device_t); +static void ale_sysctl_node(struct ale_softc *); +static void ale_tick(void *); +static void ale_tx_task(void *, int); +static void ale_txeof(struct ale_softc *); +static void ale_watchdog(struct ale_softc *); +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_ale_proc_limit(SYSCTL_HANDLER_ARGS); +static int sysctl_hw_ale_int_mod(SYSCTL_HANDLER_ARGS); + +static device_method_t ale_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, ale_probe), + DEVMETHOD(device_attach, ale_attach), + DEVMETHOD(device_detach, ale_detach), + DEVMETHOD(device_shutdown, ale_shutdown), + DEVMETHOD(device_suspend, ale_suspend), + DEVMETHOD(device_resume, ale_resume), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, ale_miibus_readreg), + DEVMETHOD(miibus_writereg, ale_miibus_writereg), + DEVMETHOD(miibus_statchg, ale_miibus_statchg), + + { NULL, NULL } +}; + +static driver_t ale_driver = { + "ale", + ale_methods, + sizeof(struct ale_softc) +}; + +static devclass_t ale_devclass; + +DRIVER_MODULE(ale, pci, ale_driver, ale_devclass, 0, 0); +DRIVER_MODULE(miibus, ale, miibus_driver, miibus_devclass, 0, 0); + +static struct resource_spec ale_res_spec_mem[] = { + { SYS_RES_MEMORY, PCIR_BAR(0), RF_ACTIVE }, + { -1, 0, 0 } +}; + +static struct resource_spec ale_irq_spec_legacy[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; + +static struct resource_spec ale_irq_spec_msi[] = { + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static struct resource_spec ale_irq_spec_msix[] = { + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static int +ale_miibus_readreg(device_t dev, int phy, int reg) +{ + struct ale_softc *sc; + uint32_t v; + int i; + + sc = device_get_softc(dev); + + if (phy != sc->ale_phyaddr) + return (0); + + CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | + MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); + for (i = ALE_PHY_TIMEOUT; i > 0; i--) { + DELAY(5); + v = CSR_READ_4(sc, ALE_MDIO); + if ((v & (MDIO_OP_EXECUTE | MDIO_OP_BUSY)) == 0) + break; + } + + if (i == 0) { + device_printf(sc->ale_dev, "phy read timeout : %d\n", reg); + return (0); + } + + return ((v & MDIO_DATA_MASK) >> MDIO_DATA_SHIFT); +} + +static int +ale_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct ale_softc *sc; + uint32_t v; + int i; + + sc = device_get_softc(dev); + + if (phy != sc->ale_phyaddr) + return (0); + + CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | + (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | + MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); + for (i = ALE_PHY_TIMEOUT; i > 0; i--) { + DELAY(5); + v = CSR_READ_4(sc, ALE_MDIO); + if ((v & (MDIO_OP_EXECUTE | MDIO_OP_BUSY)) == 0) + break; + } + + if (i == 0) + device_printf(sc->ale_dev, "phy write timeout : %d\n", reg); + + return (0); +} + +static void +ale_miibus_statchg(device_t dev) +{ + struct ale_softc *sc; + + sc = device_get_softc(dev); + + taskqueue_enqueue(taskqueue_swi, &sc->ale_link_task); +} + +static void +ale_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct ale_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + ALE_LOCK(sc); + mii = device_get_softc(sc->ale_miibus); + + mii_pollstat(mii); + ALE_UNLOCK(sc); + ifmr->ifm_status = mii->mii_media_status; + ifmr->ifm_active = mii->mii_media_active; +} + +static int +ale_mediachange(struct ifnet *ifp) +{ + struct ale_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + ALE_LOCK(sc); + mii = device_get_softc(sc->ale_miibus); + if (mii->mii_instance != 0) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + } + error = mii_mediachg(mii); + ALE_UNLOCK(sc); + + return (error); +} + +static int +ale_probe(device_t dev) +{ + struct ale_dev *sp; + int i; + uint16_t vendor, devid; + + vendor = pci_get_vendor(dev); + devid = pci_get_device(dev); + sp = ale_devs; + for (i = 0; i < sizeof(ale_devs) / sizeof(ale_devs[0]); i++) { + if (vendor == sp->ale_vendorid && + devid == sp->ale_deviceid) { + device_set_desc(dev, sp->ale_name); + return (BUS_PROBE_DEFAULT); + } + sp++; + } + + return (ENXIO); +} + +static void +ale_get_macaddr(struct ale_softc *sc) +{ + uint32_t ea[2], reg; + int i, vpdc; + + reg = CSR_READ_4(sc, ALE_SPI_CTRL); + if ((reg & SPI_VPD_ENB) != 0) { + reg &= ~SPI_VPD_ENB; + CSR_WRITE_4(sc, ALE_SPI_CTRL, reg); + } + + if (pci_find_extcap(sc->ale_dev, PCIY_VPD, &vpdc) == 0) { + /* + * PCI VPD capability found, let TWSI reload EEPROM. + * This will set ethernet address of controller. + */ + CSR_WRITE_4(sc, ALE_TWSI_CTRL, CSR_READ_4(sc, ALE_TWSI_CTRL) | + TWSI_CTRL_SW_LD_START); + for (i = 100; i > 0; i--) { + DELAY(1000); + reg = CSR_READ_4(sc, ALE_TWSI_CTRL); + if ((reg & TWSI_CTRL_SW_LD_START) == 0) + break; + } + if (i == 0) + device_printf(sc->ale_dev, + "reloading EEPROM timeout!\n"); + } else { + if (bootverbose) + device_printf(sc->ale_dev, + "PCI VPD capability not found!\n"); + } + + ea[0] = CSR_READ_4(sc, ALE_PAR0); + ea[1] = CSR_READ_4(sc, ALE_PAR1); + sc->ale_eaddr[0] = (ea[1] >> 8) & 0xFF; + sc->ale_eaddr[1] = (ea[1] >> 0) & 0xFF; + sc->ale_eaddr[2] = (ea[0] >> 24) & 0xFF; + sc->ale_eaddr[3] = (ea[0] >> 16) & 0xFF; + sc->ale_eaddr[4] = (ea[0] >> 8) & 0xFF; + sc->ale_eaddr[5] = (ea[0] >> 0) & 0xFF; +} + +static void +ale_phy_reset(struct ale_softc *sc) +{ + + /* Reset magic from Linux. */ + CSR_WRITE_2(sc, ALE_GPHY_CTRL, + GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE | GPHY_CTRL_SEL_ANA_RESET | + GPHY_CTRL_PHY_PLL_ON); + DELAY(1000); + CSR_WRITE_2(sc, ALE_GPHY_CTRL, + GPHY_CTRL_EXT_RESET | GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE | + GPHY_CTRL_SEL_ANA_RESET | GPHY_CTRL_PHY_PLL_ON); + DELAY(1000); + +#define ATPHY_DBG_ADDR 0x1D +#define ATPHY_DBG_DATA 0x1E + + /* Enable hibernation mode. */ + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_ADDR, 0x0B); + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_DATA, 0xBC00); + /* Set Class A/B for all modes. */ + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_ADDR, 0x00); + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_DATA, 0x02EF); + /* Enable 10BT power saving. */ + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_ADDR, 0x12); + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_DATA, 0x4C04); + /* Adjust 1000T power. */ + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_ADDR, 0x04); + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_ADDR, 0x8BBB); + /* 10BT center tap voltage. */ + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_ADDR, 0x05); + ale_miibus_writereg(sc->ale_dev, sc->ale_phyaddr, + ATPHY_DBG_ADDR, 0x2C46); + +#undef ATPHY_DBG_ADDR +#undef ATPHY_DBG_DATA + DELAY(1000); +} + +static int +ale_attach(device_t dev) +{ + struct ale_softc *sc; + struct ifnet *ifp; + uint16_t burst; + int error, i, msic, msixc, pmc; + uint32_t rxf_len, txf_len; + + error = 0; + sc = device_get_softc(dev); + sc->ale_dev = dev; + + mtx_init(&sc->ale_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + callout_init_mtx(&sc->ale_tick_ch, &sc->ale_mtx, 0); + TASK_INIT(&sc->ale_int_task, 0, ale_int_task, sc); + TASK_INIT(&sc->ale_link_task, 0, ale_link_task, sc); + + /* Map the device. */ + pci_enable_busmaster(dev); + sc->ale_res_spec = ale_res_spec_mem; + sc->ale_irq_spec = ale_irq_spec_legacy; + error = bus_alloc_resources(dev, sc->ale_res_spec, sc->ale_res); + if (error != 0) { + device_printf(dev, "cannot allocate memory resources.\n"); + goto fail; + } + + /* Set PHY address. */ + sc->ale_phyaddr = ALE_PHY_ADDR; + + /* Reset PHY. */ + ale_phy_reset(sc); + + /* Reset the ethernet controller. */ + ale_reset(sc); + + /* Get PCI and chip id/revision. */ + sc->ale_rev = pci_get_revid(dev); + if (sc->ale_rev >= 0xF0) { + /* L2E Rev. B. AR8114 */ + sc->ale_flags |= ALE_FLAG_FASTETHER; + } else { + if ((CSR_READ_4(sc, ALE_PHY_STATUS) & PHY_STATUS_100M) != 0) { + /* L1E AR8121 */ + sc->ale_flags |= ALE_FLAG_JUMBO; + } else { + /* L2E Rev. A. AR8113 */ + sc->ale_flags |= ALE_FLAG_FASTETHER; + } + } + /* + * All known controllers seems to require 4 bytes alignment + * of Tx buffers to make Tx checksum offload with custom + * checksum generation method work. + */ + sc->ale_flags |= ALE_FLAG_TXCSUM_BUG; + /* + * All known controllers seems to have issues on Rx checksum + * offload for fragmented IP datagrams. + */ + sc->ale_flags |= ALE_FLAG_RXCSUM_BUG; + /* + * Don't use Tx CMB. It is known to cause RRS update failure + * under certain circumstances. Typical phenomenon of the + * issue would be unexpected sequence number encountered in + * Rx handler. + */ + sc->ale_flags |= ALE_FLAG_TXCMB_BUG; + sc->ale_chip_rev = CSR_READ_4(sc, ALE_MASTER_CFG) >> + MASTER_CHIP_REV_SHIFT; + if (bootverbose) { + device_printf(dev, "PCI device revision : 0x%04x\n", + sc->ale_rev); + device_printf(dev, "Chip id/revision : 0x%04x\n", + sc->ale_chip_rev); + } + txf_len = CSR_READ_4(sc, ALE_SRAM_TX_FIFO_LEN); + rxf_len = CSR_READ_4(sc, ALE_SRAM_RX_FIFO_LEN); + /* + * Uninitialized hardware returns an invalid chip id/revision + * as well as 0xFFFFFFFF for Tx/Rx fifo length. + */ + if (sc->ale_chip_rev == 0xFFFF || txf_len == 0xFFFFFFFF || + rxf_len == 0xFFFFFFF) { + device_printf(dev,"chip revision : 0x%04x, %u Tx FIFO " + "%u Rx FIFO -- not initialized?\n", sc->ale_chip_rev, + txf_len, rxf_len); + error = ENXIO; + goto fail; + } + device_printf(dev, "%u Tx FIFO, %u Rx FIFO\n", txf_len, rxf_len); + + /* Allocate IRQ resources. */ + msixc = pci_msix_count(dev); + msic = pci_msi_count(dev); + if (bootverbose) { + device_printf(dev, "MSIX count : %d\n", msixc); + device_printf(dev, "MSI count : %d\n", msic); + } + + /* Prefer MSIX over MSI. */ + if (msix_disable == 0 || msi_disable == 0) { + if (msix_disable == 0 && msixc == ALE_MSIX_MESSAGES && + pci_alloc_msix(dev, &msixc) == 0) { + if (msic == ALE_MSIX_MESSAGES) { + device_printf(dev, "Using %d MSIX messages.\n", + msixc); + sc->ale_flags |= ALE_FLAG_MSIX; + sc->ale_irq_spec = ale_irq_spec_msix; + } else + pci_release_msi(dev); + } + if (msi_disable == 0 && (sc->ale_flags & ALE_FLAG_MSIX) == 0 && + msic == ALE_MSI_MESSAGES && + pci_alloc_msi(dev, &msic) == 0) { + if (msic == ALE_MSI_MESSAGES) { + device_printf(dev, "Using %d MSI messages.\n", + msic); + sc->ale_flags |= ALE_FLAG_MSI; + sc->ale_irq_spec = ale_irq_spec_msi; + } else + pci_release_msi(dev); + } + } + + error = bus_alloc_resources(dev, sc->ale_irq_spec, sc->ale_irq); + if (error != 0) { + device_printf(dev, "cannot allocate IRQ resources.\n"); + goto fail; + } + + /* Get DMA parameters from PCIe device control register. */ + if (pci_find_extcap(dev, PCIY_EXPRESS, &i) == 0) { + sc->ale_flags |= ALE_FLAG_PCIE; + burst = pci_read_config(dev, i + 0x08, 2); + /* Max read request size. */ + sc->ale_dma_rd_burst = ((burst >> 12) & 0x07) << + DMA_CFG_RD_BURST_SHIFT; + /* Max payload size. */ + sc->ale_dma_wr_burst = ((burst >> 5) & 0x07) << + DMA_CFG_WR_BURST_SHIFT; + if (bootverbose) { + device_printf(dev, "Read request size : %d bytes.\n", + 128 << ((burst >> 12) & 0x07)); + device_printf(dev, "TLP payload size : %d bytes.\n", + 128 << ((burst >> 5) & 0x07)); + } + } else { + sc->ale_dma_rd_burst = DMA_CFG_RD_BURST_128; + sc->ale_dma_wr_burst = DMA_CFG_WR_BURST_128; + } + + /* Create device sysctl node. */ + ale_sysctl_node(sc); + + if ((error = ale_dma_alloc(sc) != 0)) + goto fail; + + /* Load station address. */ + ale_get_macaddr(sc); + + ifp = sc->ale_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "cannot allocate ifnet structure.\n"); + error = ENXIO; + goto fail; + } + + ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = ale_ioctl; + ifp->if_start = ale_start; + ifp->if_init = ale_init; + ifp->if_snd.ifq_drv_maxlen = ALE_TX_RING_CNT - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); + ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4; + ifp->if_hwassist = ALE_CSUM_FEATURES | CSUM_TSO; +#ifdef ENABLE_WOL + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) { + sc->ale_flags |= ALE_FLAG_PMCAP; + ifp->if_capabilities |= IFCAP_WOL_MAGIC | IFCAP_WOL_MCAST; + } +#endif + ifp->if_capenable = ifp->if_capabilities; + + /* Set up MII bus. */ + if ((error = mii_phy_probe(dev, &sc->ale_miibus, ale_mediachange, + ale_mediastatus)) != 0) { + device_printf(dev, "no PHY found!\n"); + goto fail; + } + + ether_ifattach(ifp, sc->ale_eaddr); + + /* VLAN capability setup. */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capenable = ifp->if_capabilities; + + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + + /* Create local taskq. */ + TASK_INIT(&sc->ale_tx_task, 1, ale_tx_task, ifp); + sc->ale_tq = taskqueue_create_fast("ale_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->ale_tq); + if (sc->ale_tq == NULL) { + device_printf(dev, "could not create taskqueue.\n"); + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + taskqueue_start_threads(&sc->ale_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->ale_dev)); + + if ((sc->ale_flags & ALE_FLAG_MSIX) != 0) + msic = ALE_MSIX_MESSAGES; + else if ((sc->ale_flags & ALE_FLAG_MSI) != 0) + msic = ALE_MSI_MESSAGES; + else + msic = 1; + for (i = 0; i < msic; i++) { + error = bus_setup_intr(dev, sc->ale_irq[i], + INTR_TYPE_NET | INTR_MPSAFE, ale_intr, NULL, sc, + &sc->ale_intrhand[i]); + if (error != 0) + break; + } + if (error != 0) { + device_printf(dev, "could not set up interrupt handler.\n"); + taskqueue_free(sc->ale_tq); + sc->ale_tq = NULL; + ether_ifdetach(ifp); + goto fail; + } + +fail: + if (error != 0) + ale_detach(dev); + + return (error); +} + +static int +ale_detach(device_t dev) +{ + struct ale_softc *sc; + struct ifnet *ifp; + int i, msic; + + sc = device_get_softc(dev); + + ifp = sc->ale_ifp; + if (device_is_attached(dev)) { + ALE_LOCK(sc); + sc->ale_flags |= ALE_FLAG_DETACH; + ale_stop(sc); + ALE_UNLOCK(sc); + callout_drain(&sc->ale_tick_ch); + taskqueue_drain(sc->ale_tq, &sc->ale_int_task); + taskqueue_drain(sc->ale_tq, &sc->ale_tx_task); + taskqueue_drain(taskqueue_swi, &sc->ale_link_task); + ether_ifdetach(ifp); + } + + if (sc->ale_tq != NULL) { + taskqueue_drain(sc->ale_tq, &sc->ale_int_task); + taskqueue_free(sc->ale_tq); + sc->ale_tq = NULL; + } + + if (sc->ale_miibus != NULL) { + device_delete_child(dev, sc->ale_miibus); + sc->ale_miibus = NULL; + } + bus_generic_detach(dev); + ale_dma_free(sc); + + if (ifp != NULL) { + if_free(ifp); + sc->ale_ifp = NULL; + } + + if ((sc->ale_flags & ALE_FLAG_MSIX) != 0) + msic = ALE_MSIX_MESSAGES; + else if ((sc->ale_flags & ALE_FLAG_MSI) != 0) + msic = ALE_MSI_MESSAGES; + else + msic = 1; + for (i = 0; i < msic; i++) { + if (sc->ale_intrhand[i] != NULL) { + bus_teardown_intr(dev, sc->ale_irq[i], + sc->ale_intrhand[i]); + sc->ale_intrhand[i] = NULL; + } + } + + bus_release_resources(dev, sc->ale_irq_spec, sc->ale_irq); + if ((sc->ale_flags & (ALE_FLAG_MSI | ALE_FLAG_MSIX)) != 0) + pci_release_msi(dev); + bus_release_resources(dev, sc->ale_res_spec, sc->ale_res); + mtx_destroy(&sc->ale_mtx); + + return (0); +} + +#define ALE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +#if __FreeBSD_version > 800000 +#define ALE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) +#else +#define ALE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_ULONG(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) +#endif + +static void +ale_sysctl_node(struct ale_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct ale_hw_stats *stats; + int error; + + stats = &sc->ale_stats; + ctx = device_get_sysctl_ctx(sc->ale_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ale_dev)); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_rx_mod, 0, + sysctl_hw_ale_int_mod, "I", "ale Rx interrupt moderation"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_tx_mod, 0, + sysctl_hw_ale_int_mod, "I", "ale Tx interrupt moderation"); + /* Pull in device tunables. */ + sc->ale_int_rx_mod = ALE_IM_RX_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->ale_dev), + device_get_unit(sc->ale_dev), "int_rx_mod", &sc->ale_int_rx_mod); + if (error == 0) { + if (sc->ale_int_rx_mod < ALE_IM_TIMER_MIN || + sc->ale_int_rx_mod > ALE_IM_TIMER_MAX) { + device_printf(sc->ale_dev, "int_rx_mod value out of " + "range; using default: %d\n", + ALE_IM_RX_TIMER_DEFAULT); + sc->ale_int_rx_mod = ALE_IM_RX_TIMER_DEFAULT; + } + } + sc->ale_int_tx_mod = ALE_IM_TX_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->ale_dev), + device_get_unit(sc->ale_dev), "int_tx_mod", &sc->ale_int_tx_mod); + if (error == 0) { + if (sc->ale_int_tx_mod < ALE_IM_TIMER_MIN || + sc->ale_int_tx_mod > ALE_IM_TIMER_MAX) { + device_printf(sc->ale_dev, "int_tx_mod value out of " + "range; using default: %d\n", + ALE_IM_TX_TIMER_DEFAULT); + sc->ale_int_tx_mod = ALE_IM_TX_TIMER_DEFAULT; + } + } + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", + CTLTYPE_INT | CTLFLAG_RW, &sc->ale_process_limit, 0, + sysctl_hw_ale_proc_limit, "I", + "max number of Rx events to process"); + /* Pull in device tunables. */ + sc->ale_process_limit = ALE_PROC_DEFAULT; + error = resource_int_value(device_get_name(sc->ale_dev), + device_get_unit(sc->ale_dev), "process_limit", + &sc->ale_process_limit); + if (error == 0) { + if (sc->ale_process_limit < ALE_PROC_MIN || + sc->ale_process_limit > ALE_PROC_MAX) { + device_printf(sc->ale_dev, + "process_limit value out of range; " + "using default: %d\n", ALE_PROC_DEFAULT); + sc->ale_process_limit = ALE_PROC_DEFAULT; + } + } + + /* Misc statistics. */ + ALE_SYSCTL_STAT_ADD32(ctx, child, "reset_brk_seq", + &stats->reset_brk_seq, + "Controller resets due to broken Rx sequnce number"); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "ATE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_frames, "Good frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->rx_bcast_frames, "Good broadcast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->rx_mcast_frames, "Good multicast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->rx_pause_frames, "Pause control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "control_frames", + &stats->rx_control_frames, "Control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", + &stats->rx_crcerrs, "CRC errors"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "len_errs", + &stats->rx_lenerrs, "Frames with length mismatched"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->rx_bytes, "Good octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_bcast_octets", + &stats->rx_bcast_bytes, "Good broadcast octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_mcast_octets", + &stats->rx_mcast_bytes, "Good multicast octets"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Too short frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "fragments", + &stats->rx_fragments, "Fragmented frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->rx_pkts_64, "64 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->rx_pkts_65_127, "65 to 127 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->rx_pkts_128_255, "128 to 255 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->rx_pkts_256_511, "256 to 511 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->rx_pkts_512_1023, "512 to 1023 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->rx_pkts_1519_max, "1519 to max frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "trunc_errs", + &stats->rx_pkts_truncated, "Truncated frames due to MTU size"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "rrs_errs", + &stats->rx_rrs_errs, "Return status write-back errors"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "align_errs", + &stats->rx_alignerrs, "Alignment errors"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "filtered", + &stats->rx_pkts_filtered, + "Frames dropped due to address filtering"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_frames, "Good frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->tx_bcast_frames, "Good broadcast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->tx_mcast_frames, "Good multicast frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->tx_pause_frames, "Pause control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "control_frames", + &stats->tx_control_frames, "Control frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "excess_defers", + &stats->tx_excess_defer, "Frames with excessive derferrals"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "defers", + &stats->tx_excess_defer, "Frames with derferrals"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->tx_bytes, "Good octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_bcast_octets", + &stats->tx_bcast_bytes, "Good broadcast octets"); + ALE_SYSCTL_STAT_ADD64(ctx, child, "good_mcast_octets", + &stats->tx_mcast_bytes, "Good multicast octets"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->tx_pkts_64, "64 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->tx_pkts_65_127, "65 to 127 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->tx_pkts_128_255, "128 to 255 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->tx_pkts_256_511, "256 to 511 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->tx_pkts_512_1023, "512 to 1023 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + ALE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->tx_pkts_1519_max, "1519 to max frames"); [... truncated: 3615 lines follow ...] From anevilyak at gmail.com Wed Dec 3 21:23:17 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Wed, 3 Dec 2008 14:23:17 -0600 Subject: [Haiku-commits] r28771 - in haiku/trunk/src/add-ons/kernel/drivers/network: . ar81xx ar81xx/dev ar81xx/dev/ale ar81xx/dev/mii In-Reply-To: <200812032010.mB3KApr9023911@sheep.berlios.de> References: <200812032010.mB3KApr9023911@sheep.berlios.de> Message-ID: On Wed, Dec 3, 2008 at 2:10 PM, wrote: > Author: colacoder > Date: 2008-12-03 21:10:48 +0100 (Wed, 03 Dec 2008) > New Revision: 28771 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28771&view=rev > > Added: > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/ > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/Jamfile > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/Jamfile > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/ > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/Jamfile > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/glue.c > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_alereg.h > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_alevar.h > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/ > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/Jamfile > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/ukphy.c > haiku/trunk/src/add-ons/kernel/drivers/network/ar81xx/dev/mii/ukphy_subr.c > Modified: > haiku/trunk/src/add-ons/kernel/drivers/network/Jamfile > Log: > Add network driver for Atheros AR8121/AR8113/AR8114 controllers to the build. These are used in the EeePC 901 and later. > > Nice :) Is it deliberate that it's not part of the image yet? Regards, Rene From axeld at mail.berlios.de Wed Dec 3 22:23:05 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 3 Dec 2008 22:23:05 +0100 Subject: [Haiku-commits] r28772 - haiku/trunk/data/etc Message-ID: <200812032123.mB3LN5eq032646@sheep.berlios.de> Author: axeld Date: 2008-12-03 22:23:04 +0100 (Wed, 03 Dec 2008) New Revision: 28772 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28772&view=rev Modified: haiku/trunk/data/etc/profile Log: * Added "shopt -s checkwinsize" to our /etc/profile. This fixes bug #2514, thanks Adrian! Modified: haiku/trunk/data/etc/profile =================================================================== --- haiku/trunk/data/etc/profile 2008-12-03 20:10:48 UTC (rev 28771) +++ haiku/trunk/data/etc/profile 2008-12-03 21:23:04 UTC (rev 28772) @@ -16,6 +16,8 @@ alias la="ls -A" alias m="more" +shopt -s checkwinsize + # # and now we include a few useful things... # From colacoder at mail.berlios.de Wed Dec 3 22:28:13 2008 From: colacoder at mail.berlios.de (colacoder at mail.berlios.de) Date: Wed, 3 Dec 2008 22:28:13 +0100 Subject: [Haiku-commits] r28773 - haiku/trunk/build/jam Message-ID: <200812032128.mB3LSDb9000408@sheep.berlios.de> Author: colacoder Date: 2008-12-03 22:28:12 +0100 (Wed, 03 Dec 2008) New Revision: 28773 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28773&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: * Added the ar81xx driver to the image. Thanks for testing kvdman! Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2008-12-03 21:23:04 UTC (rev 28772) +++ haiku/trunk/build/jam/HaikuImage 2008-12-03 21:28:12 UTC (rev 28773) @@ -144,7 +144,7 @@ $(X86_ONLY)via_rhine wb840 $(X86_ONLY)ipro100 $(X86_ONLY)nforce #vlance $(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect - $(X86_ONLY)attansic_l2 usb_ecm + $(X86_ONLY)attansic_l2 $(X86_ONLY)ar81xx usb_ecm ; #BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ; BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi From anevilyak at mail.berlios.de Thu Dec 4 01:28:05 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 4 Dec 2008 01:28:05 +0100 Subject: [Haiku-commits] r28774 - haiku/trunk/src/servers/registrar/mime Message-ID: <200812040028.mB40S5eJ015845@sheep.berlios.de> Author: anevilyak Date: 2008-12-04 01:28:03 +0100 (Thu, 04 Dec 2008) New Revision: 28774 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28774&view=rev Modified: haiku/trunk/src/servers/registrar/mime/RegistrarThread.cpp haiku/trunk/src/servers/registrar/mime/RegistrarThread.h Log: Defer actually spawning the thread to the call to Run(). The way the thread manager is currently written as a whole won't correctly enforce the thread limit (looking into that, though I think a different approach entirely is merited here anyways), but this at least prevents large numbers of threads from being spawned and sitting in the suspended state in the registrar forever. Fixes ticket #3172. Modified: haiku/trunk/src/servers/registrar/mime/RegistrarThread.cpp =================================================================== --- haiku/trunk/src/servers/registrar/mime/RegistrarThread.cpp 2008-12-03 21:28:12 UTC (rev 28773) +++ haiku/trunk/src/servers/registrar/mime/RegistrarThread.cpp 2008-12-04 00:28:03 UTC (rev 28774) @@ -35,17 +35,12 @@ , fIsFinished(false) , fStatus(B_NO_INIT) , fId(-1) + , fPriority(priority) { fName[0] = 0; status_t err = name && fManagerMessenger.IsValid() ? B_OK : B_BAD_VALUE; - if (!err) { - fId = spawn_thread(&RegistrarThread::EntryFunction, name, - priority, (void*)this); - err = fId >= 0 ? B_OK : fId; - } - if (!err) { + if (err == B_OK) strcpy(fName, name); - } fStatus = err; } @@ -72,8 +67,13 @@ RegistrarThread::Run() { status_t err = InitCheck(); - if (!err) - err = resume_thread(fId); + if (err == B_OK) { + fId = spawn_thread(&RegistrarThread::EntryFunction, fName, + fPriority, (void*)this); + err = fId >= 0 ? B_OK : fId; + if (err == B_OK) + err = resume_thread(fId); + } return err; } Modified: haiku/trunk/src/servers/registrar/mime/RegistrarThread.h =================================================================== --- haiku/trunk/src/servers/registrar/mime/RegistrarThread.h 2008-12-03 21:28:12 UTC (rev 28773) +++ haiku/trunk/src/servers/registrar/mime/RegistrarThread.h 2008-12-04 00:28:03 UTC (rev 28774) @@ -40,6 +40,7 @@ status_t fStatus; thread_id fId; char fName[B_OS_NAME_LENGTH]; + int32 fPriority; }; #endif // REGISTRAR_THREAD_H From anevilyak at mail.berlios.de Thu Dec 4 04:28:20 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 4 Dec 2008 04:28:20 +0100 Subject: [Haiku-commits] r28775 - haiku/trunk/src/servers/registrar/mime Message-ID: <200812040328.mB43SK1c025143@sheep.berlios.de> Author: anevilyak Date: 2008-12-04 04:28:19 +0100 (Thu, 04 Dec 2008) New Revision: 28775 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28775&view=rev Modified: haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.cpp haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.h Log: Adjust the thread counting to use atomic adds. This should prevent the previous scenario where many more threads than the limit could actually be spawned. Modified: haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.cpp =================================================================== --- haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.cpp 2008-12-04 00:28:03 UTC (rev 28774) +++ haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.cpp 2008-12-04 03:28:19 UTC (rev 28775) @@ -87,19 +87,22 @@ RegistrarThreadManager::LaunchThread(RegistrarThread *thread) { status_t err = thread ? B_OK : B_BAD_VALUE; - if (!err) - err = fThreadCount < kThreadLimit ? (status_t)B_OK : (status_t)B_NO_MORE_THREADS; + if (!err) { + if (atomic_add(&fThreadCount, 1) >= kThreadLimit) { + err = B_NO_MORE_THREADS; + atomic_add(&fThreadCount, -1); + } + } if (!err) { fThreads.push_back(thread); - fThreadCount++; err = thread->Run(); if (err) { std::list::iterator i; for (i = fThreads.begin(); i != fThreads.end();) { if ((*i) == thread) { i = fThreads.erase(i); - fThreadCount--; + atomic_add(&fThreadCount, -1); break; } else ++i; @@ -234,7 +237,7 @@ RegistrarThreadManager::RemoveThread(std::list::iterator &i) { delete *i; - fThreadCount--; + atomic_add(&fThreadCount, -1); return (i = fThreads.erase(i)); } Modified: haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.h =================================================================== --- haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.h 2008-12-04 00:28:03 UTC (rev 28774) +++ haiku/trunk/src/servers/registrar/mime/RegistrarThreadManager.h 2008-12-04 03:28:19 UTC (rev 28775) @@ -33,13 +33,13 @@ uint ThreadCount() const; - static const uint kThreadLimit = 12; + static const int kThreadLimit = 12; private: std::list::iterator& RemoveThread(std::list::iterator &i); std::list fThreads; - uint fThreadCount; + vint32 fThreadCount; }; #endif // THREAD_MANAGER_H From ingo_weinhold at gmx.de Thu Dec 4 12:36:00 2008 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Thu, 04 Dec 2008 12:36:00 +0100 Subject: [Haiku-commits] r28772 - haiku/trunk/data/etc In-Reply-To: <200812032123.mB3LN5eq032646@sheep.berlios.de> References: <200812032123.mB3LN5eq032646@sheep.berlios.de> Message-ID: <20081204123600.643.3@knochen-vm.localdomain> On 2008-12-03 at 22:23:05 [+0100], axeld at BerliOS wrote: > Author: axeld > Date: 2008-12-03 22:23:04 +0100 (Wed, 03 Dec 2008) > New Revision: 28772 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28772&view=rev > > Modified: > haiku/trunk/data/etc/profile > Log: > * Added "shopt -s checkwinsize" to our /etc/profile. This fixes bug #2514, > thanks Adrian! I thought Adek336 was Artur Wyszynski. CU, Ingo From ingo_weinhold at gmx.de Thu Dec 4 12:37:15 2008 From: ingo_weinhold at gmx.de (Ingo Weinhold) Date: Thu, 04 Dec 2008 12:37:15 +0100 Subject: [Haiku-commits] r28772 - haiku/trunk/data/etc In-Reply-To: <20081204123600.643.3@knochen-vm.localdomain> References: <200812032123.mB3LN5eq032646@sheep.berlios.de> <20081204123600.643.3@knochen-vm.localdomain> Message-ID: <20081204123715.708.4@knochen-vm.localdomain> On 2008-12-04 at 12:36:00 [+0100], Ingo Weinhold wrote: > > On 2008-12-03 at 22:23:05 [+0100], axeld at BerliOS > wrote: > > Author: axeld > > Date: 2008-12-03 22:23:04 +0100 (Wed, 03 Dec 2008) > > New Revision: 28772 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28772&view=rev > > > > Modified: > > haiku/trunk/data/etc/profile > > Log: > > * Added "shopt -s checkwinsize" to our /etc/profile. This fixes bug #2514, > > thanks Adrian! > > I thought Adek336 was Artur Wyszynski. Oh, seeing Adrian's email address, I guess I was wrong. :-) CU, Ingo From colacoder at mail.berlios.de Thu Dec 4 23:28:43 2008 From: colacoder at mail.berlios.de (colacoder at mail.berlios.de) Date: Thu, 4 Dec 2008 23:28:43 +0100 Subject: [Haiku-commits] r28776 - haiku/trunk/src/add-ons/kernel/bus_managers/acpi Message-ID: <200812042228.mB4MShrC032053@sheep.berlios.de> Author: colacoder Date: 2008-12-04 23:28:42 +0100 (Thu, 04 Dec 2008) New Revision: 28776 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28776&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_ns_dump.cpp Log: * Take into account that get_device_hid() can fail; so empty string before passing it. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_ns_dump.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_ns_dump.cpp 2008-12-04 03:28:19 UTC (rev 28775) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_ns_dump.cpp 2008-12-04 22:28:42 UTC (rev 28776) @@ -106,6 +106,7 @@ snprintf(output, sizeof(output), "%s FIELD UNIT", output); break; case ACPI_TYPE_DEVICE: + hid[0] = 0; /* zero-terminate string; get_device_hid can (and will) fail! */ device->acpi->get_device_hid(result, hid); snprintf(output, sizeof(output), "%s DEVICE (%s)", output, hid); break; From anevilyak at mail.berlios.de Fri Dec 5 00:52:30 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Fri, 5 Dec 2008 00:52:30 +0100 Subject: [Haiku-commits] r28777 - haiku/trunk/src/kits/screensaver Message-ID: <200812042352.mB4NqU1m003491@sheep.berlios.de> Author: anevilyak Date: 2008-12-05 00:52:28 +0100 (Fri, 05 Dec 2008) New Revision: 28777 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28777&view=rev Modified: haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp Log: Break up the screen saver update interval into 50 msec ticks. This lets us quickly evaluate if it's time to exit the screen saver, which would previously have blocked until the tick interval was up. This fixes ticket #2339. Modified: haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp =================================================================== --- haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-04 22:28:42 UTC (rev 28776) +++ haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-04 23:52:28 UTC (rev 28777) @@ -173,6 +173,7 @@ void ScreenSaverRunner::_Run() { + const uint32 kTickBase = 50000; if (fWindow->Lock()) { fView->SetViewColor(0, 0, 0); fView->SetLowColor(0, 0, 0); @@ -183,10 +184,20 @@ int32 snoozeCount = 0; int32 frame = 0; + int32 tickCounter = 0; + bigtime_t tick = fSaver ? fSaver->TickSize() : kTickBase; while (!fQuitting) { - bigtime_t tick = fSaver ? fSaver->TickSize() : 50000; - snooze(tick); + // break the idle time up into ticks so that we can evaluate + // the quit condition with greater responsiveness + // otherwise a screen saver that sets, say, a 30 second tick + // will result in the screen saver not responding to deactivation + // for that length of time + snooze(kTickBase); + if (++tickCounter * kTickBase < tick) + continue; + else + tickCounter = 0; if (snoozeCount) { // if we are sleeping, do nothing From anevilyak at mail.berlios.de Fri Dec 5 05:13:35 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Fri, 5 Dec 2008 05:13:35 +0100 Subject: [Haiku-commits] r28778 - haiku/trunk/build/jam Message-ID: <200812050413.mB54DZCF026992@sheep.berlios.de> Author: anevilyak Date: 2008-12-05 05:13:34 +0100 (Fri, 05 Dec 2008) New Revision: 28778 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28778&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Updated CVS package courtesy of the HaikuPorts crew - fixes the root user commit problem. Thanks! Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2008-12-04 23:52:28 UTC (rev 28777) +++ haiku/trunk/build/jam/OptionalPackages 2008-12-05 04:13:34 UTC (rev 28778) @@ -164,8 +164,8 @@ Echo "No optional package CVS available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; - InstallOptionalHaikuImagePackage cvs-1.12.13-gcc2-2008-11-29 - : $(baseURL)/cvs-1.12.13-gcc2-2008-11-29.zip + InstallOptionalHaikuImagePackage cvs-1.12.13-gcc2-2008-12-04 + : $(baseURL)/cvs-1.12.13-gcc2-2008-12-04.zip : ; } From korli at mail.berlios.de Fri Dec 5 20:08:24 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Fri, 5 Dec 2008 20:08:24 +0100 Subject: [Haiku-commits] r28779 - haiku/trunk/src/preferences/devices Message-ID: <200812051908.mB5J8OTt003963@sheep.berlios.de> Author: korli Date: 2008-12-05 20:08:21 +0100 (Fri, 05 Dec 2008) New Revision: 28779 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28779&view=rev Modified: haiku/trunk/src/preferences/devices/pci.ids Log: update 20081205 Modified: haiku/trunk/src/preferences/devices/pci.ids =================================================================== --- haiku/trunk/src/preferences/devices/pci.ids 2008-12-05 04:13:34 UTC (rev 28778) +++ haiku/trunk/src/preferences/devices/pci.ids 2008-12-05 19:08:21 UTC (rev 28779) @@ -1,18 +1,18 @@ # # List of PCI ID's # +# Version: 2008.12.05 +# Date: 2008-12-05 03:15:01 +# # Maintained by Martin Mares and other volunteers from the -# Linux PCI ID's Project at http://pciids.sf.net/. +# PCI ID Project at http://pciids.sf.net/. # -# New data are always welcome, especially if accurate. If you have -# anything to contribute, please follow the instructions at the web site -# or send a diff -u against the most recent pci.ids to pci-ids at ucw.cz. +# New data are always welcome, especially if they are accurate. If you have +# anything to contribute, please follow the instructions at the web site. # # This file can be distributed under either the GNU General Public License # (version 2 or higher) or the 3-clause BSD License. # -# Daily snapshot on Sat 2008-07-19 01:05:02 -# # Vendors, devices and subsystems. Please keep sorted. @@ -21,7 +21,10 @@ # device device_name <-- single tab # subvendor subdevice subsystem_name <-- two tabs -0000 Gammagraphx, Inc. +0000 Gammagraphx, Inc. (or missing ID) +0010 Allied Telesyn International +# This is a relabelled RTL-8139 + 8139 AT-2500TX V3 Ethernet 001a Ascend Communications, Inc. 001c PEAK-System Technik GmbH 0001 PCAN-PCI CAN-Bus controller @@ -40,6 +43,7 @@ 4800 WinTV PVR-350 4801 WinTV PVR-250 MCE 4803 WinTV PVR-250 + 7444 WinTV HVR-1600 7801 WinTV HVR-1800 MCE 8003 WinTV PVR-150 8801 WinTV PVR-150 @@ -70,6 +74,7 @@ 0315 SK-Electronics Co., Ltd. 0357 TTTech AG 000a TTP-Monitoring Card V2.0 +036f Trigem Computer Inc. 0403 Future Technology Devices International Ltd 0432 SCM Microsystems, Inc. 0001 Pluto2 DVB-T Receiver for PCMCIA [EasyWatch MobilSet] @@ -81,7 +86,7 @@ 8818 CS8818 USB2.0-to-ATAPI Bridge Controller with Embedded PHY 050d Belkin 001a FSD7000 802.11g PCI Wireless card - 0109 F5U409-CU USB/Serial Portable Adapter + 700f F5D7001 - Wireless G Plus Desktop Card 7050 F5D7050 802.11g Wireless USB Adapter 705c F5D7050 v4 058f Alcor Micro Corporation @@ -97,15 +102,18 @@ 1702 IS64PH ISDN Adapter 1703 ISDN Adapter (PCI Bus, DV, W) 1704 ISDN Adapter (PCI Bus, D, C) -067b Prolific Technology, Inc. - 3507 PL-3507 Hi-Speed USB & IEEE 1394 Combo to IDE Bridge Controller 069d Hughes Network Systems (HNS) 0721 Sapphire, Inc. +0795 Wired Inc. + 6663 Butane II (MPEG2 encoder board) + 6666 MediaPress (MPEG2 encoder board) 07ca AVerMedia Technologies Inc. a301 AVerTV 301 b808 AVerTV DVB-T Volar (USB 2.0) 07e2 ELMEG Communication Systems GmbH 0842 NPG, Personal Grand Technology +# Nee Gemplus International, SA +08e6 Gemalto NV 08ff AuthenTec afe4 [Anchor] AF-S2 FingerLoc Sensor Module 0925 First International Computer, Inc. @@ -113,6 +121,7 @@ 093a PixArt Imaging Inc. 010e Innovage Mini Digital Camera 010f SDC-300 Webcam + 020f Digital Photo Viewer 2468 CIF Single Chip 2600 PAC7311 2603 Philips Webcam SPC500NC @@ -122,7 +131,7 @@ 0a89 BREA Technologies Inc 0ace ZyDAS 1211 ZD1211 IEEE 802.11b+g USB Adapter -0b0b Rhino Equiment Corp. +0b0b Rhino Equipment Corp. 0105 Rhino R1T1 0205 Rhino R4FXO 0206 RCB4FXO 4-channel FXO analog telphony card @@ -137,6 +146,7 @@ 0905 R1T3 Single T3 Digital Telephony Card 0906 RCB24FXX 24-channel modular analog telphony card 0a06 RCB672FXX 672-channel modular analog telphony card +0b3d Brontes Technologies 0b49 ASCII Corporation 064f Trance Vibrator 0ccd TerraTec Electronic GmbH @@ -171,11 +181,6 @@ 3033 QVision 1280/p 3034 QVision 1280/p 4000 4000 [Triflex] - 4030 SMART-2/P - 4031 SMART-2SL - 4032 Smart Array 3200 - 4033 Smart Array 3100ES - 4034 Smart Array 221 4040 Integrated Array 4048 Compaq Raid LC2 4050 Smart Array 4200 @@ -205,6 +210,7 @@ 0e11 4031 Smart-2SL Array Controller 0e11 4032 Smart Array 3200 Controller 0e11 4033 Smart Array 3100ES Controller + 0e11 4034 Smart Array 221 Controller ae29 MIS-L ae2a MPC ae2b MIS-E @@ -248,11 +254,14 @@ b200 Memory Hot-Plug Controller b203 Integrated Lights Out Controller b204 Integrated Lights Out Processor + c000 Remote Insight Lights-Out Edition f130 NetFlex-3/P ThunderLAN 1.0 f150 NetFlex-3/P ThunderLAN 2.3 0e21 Cowon Systems, Inc. 0e55 HaSoTec GmbH 0eac SHF Communication Technologies AG + 0008 Ethernet Powerlink Managing Node 01 +0f62 Acrox Technologies Co., Ltd. # Formerly NCR 1000 LSI Logic / Symbios Logic 0001 53c810 @@ -315,10 +324,10 @@ 4c53 1310 P017 mezzanine (64-bit PMC) 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI 0e11 00da ProLiant ML 350 - 1028 0123 PowerEdge 2600 - 1028 014a PowerEdge 1750 + 1028 0123 LSI Logic 1020/1030 + 1028 014a LSI Logic 1020/1030 1028 016c PowerEdge 1850 MPT Fusion SCSI/RAID (Perc 4) - 1028 0183 PowerEdge 1800 + 1028 0183 LSI Logic 1020/1030 1028 018a PERC 4/IM 1028 1010 LSI U320 SCSI Controller 103c 12c5 Ultra320 SCSI [A7173A] @@ -346,6 +355,7 @@ 1033 8336 SAS1068 0056 SAS1064ET PCI-Express Fusion-MPT SAS 0057 M1064E MegaRAID SAS + 8086 346c Embedded Software RAID Technology II (ESTRII) 0058 SAS1068E PCI-Express Fusion-MPT SAS 1028 021d SAS 6/iR Integrated Workstations RAID Controller 1028 1f0e SAS 6/iR Adapter RAID Controller @@ -371,7 +381,7 @@ 1028 1f0a PERC 6/E Adapter RAID Controller 1028 1f0b PERC 6/i Adapter RAID Controller 1028 1f0c PERC 6/i Integrated RAID Controller - 1028 1f0d CERC 6/i Adapter RAID Controller + 1028 1f0d PERC 6/i Integrated RAID Controller 1028 1f11 CERC 6/i Integrated RAID Controller 1033 835a MegaRAID SAS PCI Express ROMB 1043 824d MegaRAID SAS PCI Express ROMB @@ -379,6 +389,7 @@ 1170 0036 MegaRAID SAS PCI Express ROMB 15d9 c080 MegaRAID SAS PCI Express ROMB 17aa 6b7c MegaRAID SAS PCI Express ROMB + 18a1 0003 LSI MegaRAID SAS PCI Express ROMB 8086 1006 RAID Controller SRCSAS28EP 8086 100a RAID Controller SRCSAS28EV 8086 1010 RAID Controller SRCSATA28E @@ -386,6 +397,13 @@ 8086 34cd Integrated RAID Controller SROMBSAS28E 0062 SAS1078 PCI-Express Fusion-MPT SAS 1000 0062 SAS1078 PCI-Express Fusion-MPT SAS + 0064 SAS2116 PCI-Express Fusion-MPT SAS-2 [Meteor] + 0065 SAS2116 PCI-Express Fusion-MPT SAS-2 [Meteor] + 0070 SAS2004 PCI-Express Fusion-MPT SAS-2 [Spitfire] + 0072 SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] + 0074 SAS2108 PCI-Express Fusion-MPT SAS-2 [Liberator] + 0076 SAS2108 PCI-Express Fusion-MPT SAS-2 [Liberator] + 0077 SAS2108 PCI-Express Fusion-MPT SAS-2 [Liberator] 007c MegaRAID SAS 1078DE 1014 0395 ServeRAID-AR10is SAS/SATA Controller 008f 53c875J @@ -525,7 +543,7 @@ 1787 4002 Radeon 9600 XT 4153 RV350 AS [Radeon 9550] 1043 010c A9550GE/TD - 1462 932c 865PE Neo2-V (MS-6788) mainboard + 1462 932c RX9550SE-TD128 (MS-8932) 4154 RV350 AT [FireGL T2] 4155 RV350 AU [FireGL T2] 4156 RV350 AV [FireGL T2] @@ -575,6 +593,7 @@ 4353 SMBus 4354 215CT [Mach64 CT] 4358 210888CX [Mach64 CX] + 4361 IXP SB300 AC'97 Audio Controller 4363 SMBus 436e 436E Serial ATA Controller 4370 IXP SB400 AC'97 Audio Controller @@ -625,40 +644,49 @@ 1734 10b8 Realtek High Definition Audio 4380 SB600 Non-Raid-5 SATA 103c 2813 DC5750 Microtower + 1462 7327 K9AG Neo2 17f2 5999 KI690-AM2 Motherboard 4381 SB600 Raid-5 SATA 4382 SB600 AC97 Audio - 4383 SBx00 Azalia - 0206 1028 Latitude D531 + 4383 SBx00 Azalia (Intel HDA) 103c 280a DC5750 Microtower 17f2 5000 KI690-AM2 Motherboard 4384 SBx00 PCI to PCI Bridge 4385 SBx00 SMBus Controller 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 4386 SB600 USB Controller (EHCI) 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 4387 SB600 USB (OHCI0) 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 4388 SB600 USB (OHCI1) 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 4389 SB600 USB (OHCI2) 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 438a SB600 USB (OHCI3) 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 438b SB600 USB (OHCI4) 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 438c SB600 IDE 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 438d SB600 PCI to LPC Bridge 103c 280a DC5750 Microtower + 1462 7368 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 438e SB600 AC97 Modem 4390 SB700/SB800 SATA Controller [IDE mode] @@ -669,7 +697,7 @@ 4395 SB800 SATA Controller [Storage mode with HyperFlash-PCIE] 4396 SB700/SB800 USB EHCI Controller 4397 SB700/SB800 USB OHCI0 Controller - 4398 SB700/SB800 USB OHCI1 Controller + 4398 SB700 USB OHCI1 Controller 4399 SB700/SB800 USB OHCI2 Controller 439c SB700/SB800 IDE Controller 439d SB700/SB800 LPC host controller @@ -774,6 +802,7 @@ 4a4c R420 JL [Radeon X800] 4a4d R420 JM [FireGL X3] 4a4e M18 JN [Radeon Mobility 9800] + 4a4f Radeon X800 SE (R420) (AGP) 4a50 R420 JP [Radeon X800XT] 4a54 R420 [Radeon X800 VE] 4a69 R420 [Radeon X800 PRO/GTO] (Secondary) @@ -781,7 +810,9 @@ 4a6b R420 [Radeon X800] (Secondary) 4a70 R420 [X800XT-PE] (Secondary) 4a74 R420 [Radeon X800 VE] (Secondary) + 4b48 Radeon X850 Consumer (R481) 4b49 R480 [Radeon X850XT] + 4b4a Radeon X850 SE (R480) (AGP) 4b4b R480 [Radeon X850Pro] 4b4c R481 [Radeon X850XT-PE] 4b69 R480 [Radeon X850XT] (Secondary) @@ -827,6 +858,7 @@ 4c54 264LT [Mach64 LT] 4c57 Radeon Mobility M7 LW [Radeon Mobility 7500] 1014 0517 ThinkPad T30 + 1014 0530 ThinkPad T42 2373-4WU 1028 00e6 Radeon Mobility M7 LW (Dell Inspiron 8100) 1028 012a Latitude C640 1043 1622 Mobility Radeon M7 (L3C/S) @@ -850,17 +882,18 @@ 4d46 Rage Mobility M4 AGP 4d4c Rage Mobility M4 AGP 4d52 Theater 550 PRO PCI [ATI TV Wonder 550] + 4d53 Theater 550 PRO PCIe 4e44 Radeon R300 ND [Radeon 9700 Pro] 1002 515e Radeon ES1000 1002 5965 Radeon ES1000 4e45 Radeon R300 NE [Radeon 9500 Pro] 1002 0002 Radeon R300 NE [Radeon 9500 Pro] 1681 0002 Hercules 3D Prophet 9500 PRO [Radeon 9500 Pro] - 4e46 RV350 NF [Radeon 9600] + 4e46 R300 NF [Radeon 9600 TX] 4e47 Radeon R300 NG [FireGL X1] 4e48 Radeon R350 [Radeon 9800 Pro] 4e49 Radeon R350 [Radeon 9800] - 4e4a RV350 NJ [Radeon 9800 XT] + 4e4a R360 NJ [Radeon 9800 XT] 1002 4e4a R360 [Radeon 9800 XT] 4e4b R350 NK [FireGL X2] 4e50 RV350 [Mobility Radeon 9600 M10] @@ -964,6 +997,7 @@ 5155 R200 QU [Radeon 9100] 5157 Radeon RV200 QW [Radeon 7500] 1002 013a Radeon 7500 + 1002 0f2b ALL-IN-WONDER VE PCI 1002 103a Dell Optiplex GX260 1458 4000 RV200 QW [RADEON 7500 PRO MAYA AR] 148c 2024 RV200 QW [Radeon 7500LE Dual Display] @@ -986,22 +1020,36 @@ 1014 029a Remote Supervisor Adapter II (RSA2) 1014 02c8 eServer xSeries server mainboard 1028 016c PowerEdge 1850 - 1028 016d PowerEdge 2850 + 1028 016d PowerEdge 2850 Embedded Radeon 7000-M + 1028 0170 PowerEdge 6850 Embedded Radeon 7000/VE 1028 019a PowerEdge SC1425 103c 1292 Radeon 7000 + 1043 c00a A7000/T/64M 1458 4002 RV100 QY [RADEON 7000 PRO MAYA AV Series] 148c 2003 RV100 QY [Radeon 7000 Multi-Display Edition] 148c 2023 RV100 QY [Radeon 7000 Evil Master Multi-Display] + 174b 0280 Radeon RV100 QY [Radeon 7000/VE] 174b 7112 RV100 QY [Sapphire Radeon VE 7000] 174b 7c28 Sapphire Radeon VE 7000 DDR 1787 0202 RV100 QY [Excalibur Radeon 7000] 17ee 1001 Radeon 7000 64MB DDR + DVI 515a Radeon RV100 QZ [Radeon 7000/VE] 515e ES1000 + 1028 01bb PowerEdge 1955 Embedded ATI ES1000 1028 01df PowerEdge SC440 1028 01e6 PowerEdge 860 - 1028 020f PowerEdge R300 - 1028 0210 PowerEdge T300 + 1028 01f0 PowerEdge R900 Embedded ATI ES1000 + 1028 0205 PowerEdge 2970 Embedded ATI ES1000 + 1028 020b PowerEdge T605 Embedded ATI ES1000 + 1028 020f PowerEdge R300 Embedded ATI ES1000 + 1028 0210 PowerEdge T300 Embedded ATI ES1000 + 1028 0221 PowerEdge R805 Embedded ATI ES1000 + 1028 0223 PowerEdge R905 Embedded ATI ES1000 + 1028 0225 PowerEdge T105 Embedded ATI ES1000 + 1028 023c PowerEdge R200 Embedded ATI ES1000 + 103c 1304 Integrity iLO2 Advanced KVM VGA [AD307A] + 15d9 8680 X7DVL-E-O motherboard + 8086 3476 S5000PSLSATA Server Board 515f ES1000 5168 Radeon R200 Qh 5169 Radeon R200 Qi @@ -1057,21 +1105,27 @@ 5455 Rage 128 Pro Ultra TU 5460 M22 [Mobility Radeon X300] 1775 1100 CR11/VR11 Single Board Computer + 5461 M22 [Mobility Radeon X300] 5462 M24 [Radeon Mobility X600] 5464 M22 [FireGL GL] 5548 R423 UH [Radeon X800 (PCIE)] 5549 R423 UI [Radeon X800PRO (PCIE)] 554a R423 UJ [Radeon X800LE (PCIE)] 554b R423 UK [Radeon X800SE (PCIE)] + 554c Radeon X800 XTP (R430) (PCIE) 554d R430 [Radeon X800 XL] (PCIe) + 1458 2124 GV-R80L256V-B (AGP) + 554e Radeon X800 SE (R430) (PCIE) 554f R430 [Radeon X800 (PCIE)] 5550 R423 [FireGL V7100] 5551 R423 [FireGL V5100 (PCIE)] 5552 R423 UR [FireGL V5100 (PCIE)] 5554 R423 UT [FireGL V7100 (PCIE)] + 5555 R430 GL PRO 5569 R423 UI [Radeon X800PRO (PCIE)] (Secondary) 556b Radeon R423 UK (PCIE) [X800 SE] (Secondary) 556d R430 [Radeon X800 XL] (PCIe) (Secondary) + 1458 2125 GV-R80L256V-B (AGP) 556f R430 [Radeon X800] (PCIE) (Secondary) 5571 R423GL-SE [FireGL V5100 (PCIE)] (Secondary) 564a M26 [Mobility FireGL V5000] @@ -1085,6 +1139,7 @@ 1002 5654 Mach64VT Reference 5655 264VT3 [Mach64 VT3] 5656 264VT4 [Mach64 VT4] + 5657 Radeon X550/X700 Series (RV410) 5830 RS300 Host Bridge 5831 RS300 Host Bridge 5832 RS300 Host Bridge @@ -1092,6 +1147,8 @@ 5834 Radeon 9100 IGP 5835 RS300M AGP [Radeon Mobility 9100IGP] 5838 Radeon 9100 IGP AGP Bridge + 5854 Radeon Xpress Series (RS480) + 5874 Radeon Xpress Series (RS482) 5940 RV280 [Radeon 9200 PRO] (Secondary) 17af 2021 Excalibur Radeon 9250 (Secondary) 5941 RV280 [Radeon 9200] (Secondary) @@ -1145,7 +1202,7 @@ 5974 RS482 [Radeon Xpress 200] 103c 280a DC5750 Microtower 1462 7141 Aspire L250 - 5975 RS485 [Radeon Xpress 1100 IGP] + 5975 RS482 [Radeon Xpress 200M] 5978 RD790 PCI to PCI bridge (external gfx0 port A) 5979 RD790 PCI to PCI bridge (external gfx0 port B) 597a RD790 PCI to PCI bridge (PCI express gpp port A) @@ -1185,8 +1242,10 @@ 1462 7217 Aspire L250 5a41 RS400 [Radeon Xpress 200] 5a42 RS400 [Radeon Xpress 200M] + 5a43 Radeon Xpress Series (RS400) 5a61 RC410 [Radeon Xpress 200] 5a62 RC410 [Radeon Xpress 200M] + 5a63 Radeon Xpress Series (RC410) 5b60 RV370 5B60 [Radeon X300 (PCIE)] 1043 002a Extreme AX300SE-X 1043 032e Extreme AX300/TD @@ -1199,6 +1258,7 @@ 5b63 RV370 [Sapphire X550 Silent] 5b64 RV370 5B64 [FireGL V3100 (PCIE)] 5b65 RV370 5B65 [FireGL D1100 (PCIE)] + 5b66 RV370X 5b70 RV370 [Radeon X300SE] 1462 0403 RX300SE-TD128E (MS-8940) (secondary display) 174b 0501 Radeon X300SE @@ -1206,6 +1266,7 @@ 5b72 RV380 [Radeon X600] 5b73 RV370 secondary [Sapphire X550 Silent] 5b74 RV370 5B64 [FireGL V3100 (PCIE)] (Secondary) + 5b75 RV370 5B75 [FireGL D1100 (PCIE)] (Secondary) 5c61 M9+ 5C61 [Radeon Mobility 9200 (AGP)] 5c63 M9+ 5C63 [Radeon Mobility 9200 (AGP)] 1002 5c63 Apple iBook G4 2004 @@ -1223,8 +1284,12 @@ 5d48 M28 [Radeon Mobility X800XT] 5d49 M28 [Mobility FireGL V5100] 5d4a Mobility Radeon X800 + 5d4c Radeon X850 (PCIE) 5d4d R480 [Radeon X850XT Platinum (PCIE)] + 5d4e Radeon X850 SE (R480) (PCIE) 5d4f R480 [Radeon X800 GTO (PCIE)] + 5d50 FireGL V7200 (R480) (PCIE) + 5d51 R480 GL 12P 5d52 R480 [Radeon X850XT (PCIE)] (Primary) 1002 0b12 PowerColor X850XT PCIe (Primary) 1002 0b13 PowerColor X850XT PCIe (Secondary) @@ -1268,6 +1333,7 @@ 7140 RV515 [Radeon X1600] 7142 RV515 PRO [Radeon X1300/X1550 Series] 1002 0322 All-in-Wonder 2006 PCI-E Edition + 1043 0142 EAX1300PRO/TD/256M 7143 RV505 [Radeon X1550 Series] 7145 Radeon Mobility X1400 17aa 2006 Thinkpad T60 model 2007 @@ -1300,10 +1366,12 @@ 7186 RV515 [Radeon Mobility X1450] 7187 RV516 [Radeon X1300/X1550 Series] 7188 M64-S [Mobility Radeon X2300] + 103c 30c1 6910p 718a Mobility Radeon X2300 718c M62CSP64 [Mobility Radeon X1350] 718d M64CSP128 [Mobility Radeon X1450] 7193 RV516 [Radeon X1550 Series] + 7196 RV516 [Mobility Radeon X1350] 719b FireMV 2250 719f RV516LE [Radeon X1550 64-bit] 71a0 RV516 [Radeon X1300/X1550 Series] (Secondary) @@ -1318,9 +1386,12 @@ 17aa 2007 ThinkPad T60p 71c5 M56P [Radeon Mobility X1600] 103c 30a3 Compaq NW8440 + 1043 10b2 A6J-Q008 + 106b 0080 MacBook Pro 71c6 RV530LE [Radeon X1600/X1650 PRO] 71c7 RV535 [Radeon X1650 Series] 71ce RV530LE [Radeon X1600] + 71d2 RV530GL [FireGL V3400] 71d4 M56GL [Mobility FireGL V5250] 71d5 M66-P [Mobility Radeon X1700] 71d6 M66-XT [Mobility Radeon X1700] @@ -1330,6 +1401,7 @@ 71e2 RV530 [Radeon X1600] (Secondary) 71e6 RV530LE [Radeon X1650 PRO] (Secondary) 71e7 RV535 [Radeon X1650 Series] + 71f2 RV530GL [FireGL V3400 (Secondary)] 7210 M71 [Mobility Radeon X2100] 7211 M71 [Mobility Radeon X2100] (Secondary) 7240 R580 [Radeon X1900] @@ -1366,16 +1438,23 @@ 7838 Radeon 9100 IGP PCI/AGP Bridge 7910 RS690 Host Bridge 17f2 5000 KI690-AM2 Motherboard + 7911 RS690 Host Bridge 7912 RS690 PCI to PCI Bridge (Internal gfx) 7913 RS690 PCI to PCI Bridge (PCI Express Graphics Port 0) 7915 RS690 PCI to PCI Bridge (PCI Express Port 1) 7916 RS690 PCI to PCI Bridge (PCI Express Port 2) 7917 RS690 PCI to PCI Bridge (PCI Express Port 3) + 1002 7910 RS690 PCI to PCI Bridge 7919 Radeon X1200 Series Audio Controller 17f2 5000 KI690-AM2 Motherboard 791e RS690 [Radeon X1200 Series] + 1462 7327 K9AG Neo2 17f2 5000 KI690-AM2 Motherboard 791f RS690M [Radeon X1200 Series] + 7930 Radeon Xpress 7930 Host Bridge + 7932 RS7932 PCI Bridge + 7933 RS7933 PCI Bridge + 7936 RS7936 PCI Bridge 793b RS600 audio device [Radeon Xpress 12xx Series] 793f RS600 [Radeon Xpress 1200 Series] 7941 RS600 [Radeon Xpress 1200 Series] @@ -1384,14 +1463,29 @@ 7c37 RV350 AQ [Radeon 9600 SE] 9400 R600 [Radeon HD 2900 Series] 1002 3000 Sapphire Radeon HD 2900 XT + 1002 3142 HIS Radeon HD 2900XT 512MB GDDR3 VIVO PCIe + 9403 R600 [Radeon HD 2900 PRO] 940a R600GL [Fire GL V8650] 940b R600GL [Fire GL V8600] - 94c1 Radeon HD 2400 XT + 940f R600 [FireGL V7600] + 9440 RV770 [Radeon HD 4870] + 9441 R700 [Radeon HD 4870 X2] + 9442 RV770 [Radeon HD 4850] + 174b e810 Sapphire HD 4850 512MB GDDR3 PCI-E Dual Slot Fansink + 9443 R700 [Radeon HD 4850] + 944a M98L [Mobility Radeon HD 4850] + 944c RV770 LE [Radeon HD 4800 Series] + 945a M98 XT [Mobility Radeon HD 4870] + 9480 M96 [Mobility Radeon HD 4650] + 9490 RV730XT [Radeon HD 4670] + 9498 RV730 PRO [Radeon HD 4650] + 94c1 RV610 [Radeon HD 2400 XT] 1028 0211 Optiplex 755 + 1028 0d02 Optiplex 755 94c3 RV610 video device [Radeon HD 2400 PRO] 1002 94c3 Radeon HD 2400PRO 174b e400 Sapphire HD 2400 PRO video device - 94c4 RV610LE [Radeon HD 2400 Series] + 94c4 RV610 LE AGP [Radeon HD 2400 PRO AGP] 94c8 Radeon HD 2400 XT 94c9 Mobility Radeon HD 2400 1002 94c9 Radeon HD2400 @@ -1399,31 +1493,50 @@ 94cc RV 610LE PCI [Radeon HD 2400] 9501 Radeon HD 3870 9504 Mobility Radeon HD 3850 - 9505 Radeon HD 3850 + 9505 RV670PRO [Radeon HD 3850] 9507 RV670 [Radeon HD 3850] 9508 M88 XT Mobility Radeon HD 3870] 950f R680 [Radeon HD 3870 x2] + 9511 RV670 [FireGL 7700] 9515 RV670 AGP [Radeon HD 3850] - 9559 Mobilitiy Radeon HD 3600 Series + 9519 RV670 [FireStream 9170] + 9540 RV710 [Radeon HD 4550] + 954f RV710 [Radeon HD 4350] + 9553 M92 [Mobility Radeon HD 4500 Series] + 9559 Mobility Radeon HD 3600 Series 9581 M76 [Radeon Mobility HD 2600 Series] + 9583 M76XT [Mobility Radeon HD 2600 XT] 9586 RV 630 XT AGP [Radeon HD 2600 XT AGP] - 9587 RV630 [Radeon HD 2600 AGP Series] + 9587 RV630 PRO AGP [Radeon HD 2600 PRO AGP] 9588 RV630 [Radeon HD 2600XT] 1458 216c Radeon HD 2600 XT, 256MB GDDR3, 2x DVI, TV-out, PCIe (GV-RX26T256H) 9589 RV630 [Radeon HD 2600 Series] - 9591 Mobilitiy Radeon HD 3650 + 958c RV630GL [FireGL v5600] + 958d RV630 [FireGL V3600] + 9591 Mobility Radeon HD 3650 + 1002 9591 Mobility Radeon HD 3650 9593 Radeon Mobility HD 3670 + 9595 M86GL [Mobility FireGL V5700] 9596 RV635 PRO AGP [Radeon HD 3650] - 9598 Mobilitiy Radeon HD 3600 Series - 95c0 Mobilitiy Radeon HD 3470 - 95c4 Mobilitiy Radeon HD 3400 Series - 95c5 Mobilitiy Radeon HD 3450 + 9598 Mobility Radeon HD 3600 Series + 1002 9598 Mobility Radeon HD 3600 + 95c0 Mobility Radeon HD 3470 + 1002 95c0 Mobility Radeon HD 3470 + 95c4 Mobility Radeon HD 3400 Series + 1002 95c4 Mobility Radeon HD 3400 + 95c5 Mobility Radeon HD 3450 + 1002 95c5 Mobility Radeon HD 3450 + 95c6 RV620 LE AGP [Radeon HD 3450] + 95cc RV620 [ATI FireGL V3700] + 95ce RV620 [FirePro 2260] + 95cf RV620 [FirePro 2260] 960f RS780 Azalia controller 9610 Radeon HD 3200 Graphics 9611 Radeon 3100 Graphics 9612 RS780M/RS780MN [Radeon HD 3200 Graphics] 9613 RS780MC [Radeon HD 3100 Graphics] 9614 Radeon HD 3300 Graphics + 9616 760G [Radeon 3000] aa00 R600 Audio Device [Radeon HD 2900 Series] aa08 RV630/M76 audio device [Radeon HD 2600 Series] aa10 RV610 audio device [Radeon HD 2400 PRO] @@ -1431,6 +1544,10 @@ aa18 Radeon HD 3870 Audio device aa20 RV635 Audio device [Radeon HD 3600 Series] aa28 RV620 Audio device [Radeon HD 34xx Series] + aa30 HD48x0 audio + 174b aa30 Sapphire HD 4850 512MB GDDR3 PCI-E Dual Slot Fansink + aa38 RV730XT Audio device [Radeon HD 4670] + ac00 Theater 600 Pro cab0 AGP Bridge [IGP 320M] cab2 RS200/RS200M AGP Bridge [IGP 340M] cab3 R200 AGP Bridge [Mobility Radeon 7000 IGP] @@ -1493,6 +1610,9 @@ 1385 f311 FA311 / FA312 (FA311 with WoL HW) 0021 PC87200 PCI to ISA Bridge 0022 DP83820 10/100/1000 Ethernet Controller + 1186 4900 DGE-500T + 1385 621a GA621 + 1385 622a GA622T 0028 Geode GX2 Host Bridge 002a CS5535 South Bridge 002b CS5535 ISA bridge @@ -1603,6 +1723,9 @@ 1498 000b TPMC880-11 Single 10/100Base-T PMC Ethernet Adapter 1498 000c TPMC880-12 Single 10Base2 PMC Ethernet Adapter 14cb 0100 LNDL-100N 100Base-TX Ethernet PC Card + 1668 2000 FastNet Pro (PE2000) + 2646 0001 KNE100TX + 2646 0002 KNE-CB4TX 8086 0001 EtherExpress PRO/100 Mobile CardBus 32 001a Farallon PN9000SX Gigabit Ethernet 0021 DECchip 21052 @@ -1668,7 +1791,8 @@ 153b 112e DMX XFire 1024 153b 1136 SiXPack 5.1+ 1681 0050 Game Theater XP - 1681 a011 Fortissimo III 7.1 + 1681 a010 Gamesurround Fortissimo II + 1681 a011 Gamesurround Fortissimo III 7.1 5053 3357 Santa Cruz 6004 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] 6005 Crystal CS4281 PCI Audio @@ -1767,6 +1891,7 @@ 0188 EADS-X PCI-X to PCI-X Bridge 01a7 PCI-X to PCI-X Bridge 01bd ServeRAID Controller + 1014 01bd ServeRAID 4Lx 1014 01be ServeRAID-4M 1014 01bf ServeRAID-4L 1014 0208 ServeRAID-4Mx @@ -1820,11 +1945,24 @@ 1019 Elitegroup Computer Systems 101a AT&T GIS (NCR) 0005 100VG ethernet - 1dc1 Bynet + 0007 BYNET BIC4G/2C/2G + 101a 0019 BYNET BIC2C + 101a 001c BYNET BIC2G + 101a 001f BYNET BIC4G + 0009 PQS Memory Controller + 000a BYNET BPCI Adapter + 000b BYNET 4 Port BYA Switch (BYA4P) + 000c BYNET 4 Port BYA Switch (BYA4G) + 0010 NCR AMC Memory Controller + 1dc1 BYNET BIC2M/BIC4M/BYA4M 101a 0019 BIC2M 101a 001f BIC4M 101a 0ece BYA4M + 1fa8 BYNET Multi-port BIC Adapter (XBIC Based) + 101a 00c3 BYNET BIC2SE 101b Vitesse Semiconductor +# Maxim VSC452 Super BMC Controller with Video + 0452 VSC452 [SuperBMC] 101c Western Digital 0193 33C193A 0196 33C196A @@ -1837,6 +1975,8 @@ 9710 Pipeline 9710 9712 Pipeline 9712 c24a 90C +# ID for Newly Acquired Storage Products from Vitesse +101d Maxim Integrated Products 101e American Megatrends Inc. 0009 MegaRAID 428 Ultra RAID Controller (rev 03) 1960 MegaRAID @@ -2045,7 +2185,6 @@ 9960 CyberBlade XP2 1024 Zenith Data Systems 1025 Acer Incorporated [ALI] - 0090 BCM440x 100Base-TX Fast Ethernet 1435 M1435 1445 M1445 1449 M1449 @@ -2171,6 +2310,7 @@ 102b 051b MGA-2164W Millennium II 102b 1100 MGA-2164W Millennium II 102b 1200 MGA-2164W Millennium II + 102b 2100 MGA-2164W Millennium II 051e MGA 1064SG [Mystique] AGP 051f MGA 2164W [Millennium II] AGP 0520 MGA G200 @@ -2271,6 +2411,14 @@ 102b 1030 Parhelia 256 MB Dual DVI 102b 14e1 Parhelia PCI 256MB 102b 2021 QID Pro + 0532 MGA G200eW WPCM450 + 1028 0287 PowerEdge M610 MGA G200eW WPCM450 + 0540 M91XX + 102b 2080 M9140 LP PCIe x16 + 102b 2100 M9120 PCIe x16 + 102b 2140 M9125 PCIe x16 + 102b 2180 M9120 Plus LP PCIe x16 + 102b 21c0 M9120 Plus LP PCIe x1 0d10 MGA Ultima/Impression 1000 MGA G100 [Productiva] 102b ff01 Productiva G100 @@ -2327,7 +2475,7 @@ 00e4 F65554 00e5 F65555 HiQVPro 0e11 b049 Armada 1700 Laptop Display Controller - 1179 0001 Satellite Pro + 1179 0001 Satellite Pro/Satellite 00f0 F68554 00f4 F68554 HiQVision 00f5 F68555 @@ -2354,6 +2502,9 @@ 0180 TX4927/38 MIPS RISC PCI Controller 0181 TX4925 MIPS RISC PCI Controller 0182 TX4937 MIPS RISC PCI Controller + 01b4 Celleb platform IDE interface + 01b5 SCC USB 2.0 EHCI controller + 01b6 SCC USB 1.1 OHCI controller 1030 TMC Research 1031 Miro Computer Products AG 5601 DC20 ASIC @@ -2381,6 +2532,8 @@ 002d PCI to C-bus Bridge 0035 USB 1033 0035 Hama USB 2.0 CardBus + 103c 1293 USB add-in card + 103c 1294 USB 2.0 add-in card 1179 0001 USB 12ee 7000 Root Hub 14c2 0105 PTI-205N USB 2.0 Host Controller @@ -2417,7 +2570,7 @@ 14c2 0205 PTI-205N USB 2.0 Host Controller 1799 0002 Root Hub 807d 1043 PCI-USB2 (EHCI subsystem) - 00e7 IEEE 1394 Host Controller + 00e7 uPD72873 IEEE1394 OHCI 1.1 2-port Host Controller 00f2 uPD72874 IEEE1394 OHCI 1.1 3-port PHY-Link Ctrlr 00f3 uPD6113x Multimedia Decoder/Processor [EMMA2] 010c VR7701 @@ -2445,7 +2598,7 @@ 0182 182 SATA/RAID Controller 1734 1095 D2030-A1 0186 AHCI Controller (0106) - 0190 190 Gigabit Ethernet Adapter + 0190 190 Ethernet Adapter 0191 191 Gigabit Ethernet Adapter 0200 5597/5598/6326 VGA 1039 0000 SiS5597 SVGA (Shared RAM) @@ -2492,8 +2645,9 @@ 1734 1099 D2030-A1 Motherboard 0900 SiS900 PCI Fast Ethernet 1019 0a14 K7S5A motherboard - 1039 0900 SiS900 10/100 Ethernet Adapter + 1039 0900 SiS900 10/100 Ethernet Adapter onboard [Asus P4SC-EA] 1043 8035 CUSI-FX motherboard + 1043 80a7 Motherboard P4S800D-X 1462 0900 MS-6701 motherboard 0961 SiS961 [MuTIOL Media IO] 0962 SiS962 [MuTIOL Media IO] @@ -2518,6 +2672,7 @@ 1039 5513 SiS5513 EIDE Controller (A,B step) 1043 8035 CUSI-FX motherboard 1462 7010 MS-6701 motherboard + 1631 5513 GA-8SIML Rev1.0 Motherboard 1734 1095 D2030-A1 Motherboard 5517 5517 5571 5571 @@ -2536,7 +2691,8 @@ 6306 530/620 PCI/AGP VGA Display Adapter 1039 6306 SiS530,620 GUI Accelerator+3D 6325 65x/M650/740 PCI/AGP VGA Display Adapter - 1039 6325 740 [315 graphics core] on ECS K7SOM+ motherboard + 1039 6325 SiS 651 onboard [Asus P4SC-EA] + 1631 1004 SiS 651C onboard [Gigabyte GA-8SIML Rev1.0] 6326 86C326 5598/6326 1039 6326 SiS6326 GUI Accelerator 1092 0a50 SpeedStar A50 @@ -2565,8 +2721,9 @@ 7007 FireWire Controller 1462 701d MS-6701 7012 AC'97 Sound Controller + 1039 7012 SiS 7012 onboard [Asus P4SC-EA] AC'97 Sound Controller 1043 818f A8S-X Motherboard - 13f6 0300 ECS K7SOM+ motherboard + 13f6 0300 CMI9739(A) on ECS K7SOM+ motherboard 1462 5850 MSI 648 Max (MS-6585) 1462 7010 MS-6701 motherboard 15bd 1001 DFI 661FX motherboard @@ -2602,7 +2759,7 @@ 7019 SiS7019 Audio Accelerator 7502 Azalia Audio Controller 103a Seiko Epson Corporation -103b Tatung Co. of America +103b Tatung Corp. Of America 103c Hewlett-Packard Company 002a NX9000 Notebook 08bc NX5000 Notebook @@ -2670,6 +2827,7 @@ 3085 Realtek RTL8139/8139C/8139C+ 30b5 Compaq Presario V3000Z 31fb DL365 ATI ES1000 VGA controller + 3206 Adaptec Embedded Serial ATA HostRAID 3220 Smart Array P600 103c 3225 3 Gb/s SAS RAID 3230 Smart Array Controller @@ -2679,11 +2837,24 @@ 103c 3237 E500 SAS Controller 103c 323d P700m SAS Controller 3238 Smart Array E200i (SAS Controller) + 323a Smart Array G6 controllers + 103c 3241 Smart Array P212 + 103c 3243 Smart Array P410 + 103c 3245 Smart Array P410i + 103c 3247 Smart Array P411 + 103c 3249 Smart Array P812 + 103c 324a HP Smart Array 712m (Mezzanine RAID controller) + 103c 324b Smart Array P711m (Mezzanine RAID controller) # Will present virtual install media as mass storage, keyboard/mouse from console session, etc. 3300 Proliant iLO2 virtual USB controller + 3301 iLO3 Serial Port # Virtual serial port which is presented on a Java applet 3302 Proliant iLO2 virtual UART 3305 Proliant iLO2 [Integrated Lights Out] controller + 3306 iLO3 Slave instrumentation & System support + 3307 iLO3 Management Processor Support and Messaging + 3308 iLO3 MS Watchdog Timer + 402f PCIe Root Port 4030 zx2 System Bus Adapter 4031 zx2 I/O Controller 4037 PCIe Local Bus Adapter @@ -2801,14 +2972,22 @@ 1049 Fountain Technologies, Inc. # nee SGS Thomson Microelectronics 104a STMicroelectronics + 0000 STLS2F Host Bridge 0008 STG 2000X 0009 STG 1764X 0010 STG4000 [3D Prophet Kyro Series] + 0201 STPC Vega Northbridge 0209 STPC Consumer/Industrial North- and Southbridge 020a STPC Atlas/ConsumerS/Consumer IIA Northbridge + 020b STPC Consumer II ISA Bridge 0210 STPC Atlas ISA Bridge 021a STPC Consumer S Southbridge 021b STPC Consumer IIA Southbridge + 0220 STPC Industrial PCI to PCCard bridge + 0228 STPC Atlas IDE + 0229 STPC Vega IDE + 0230 STPC Atlas/Vega OHCI USB Controller + 0238 STPC Vega LAN 0500 ST70137 [Unicorn] ADSL DMT Transceiver 104a 0500 BeWAN ADSL PCI st 0564 STPC Client Northbridge @@ -2855,9 +3034,10 @@ 1102 100f Graphics Blaster Extreme 3d3d 0100 Reference Permedia 2 3D 8000 PCILynx/PCILynx2 IEEE 1394 Link Layer Controller + 1443 8003 FireBoard200 e4bf 1010 CF1-1-SNARE e4bf 1020 CF1-2-SNARE - 8009 FireWire Controller + 8009 TSB12LV22 IEEE-1394 Controller 104d 8032 8032 OHCI i.LINK (IEEE 1394) Controller 8017 PCI4410 FireWire Controller 8019 TSB12LV23 IEEE-1394 Controller @@ -2865,17 +3045,23 @@ 11bd 000e Studio DV e4bf 1010 CF2-1-CYMBAL 8020 TSB12LV26 IEEE-1394 Controller (Link) + 1028 00d8 Precision 530 11bd 000f Studio DV500-1394 11bd 001c Excalibur 4.1 8021 TSB43AA22 IEEE-1394 Controller (PHY/Link Integrated) 104d 80df Vaio PCG-FX403 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 8022 TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link) + 104c 8023 TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link) 8023 TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link) 103c 088c NC8000 laptop 1043 808b K8N4-E Mainboard 1043 815b P5W DH Deluxe Motherboard + 1443 8023 FireCard400 8024 TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link) + 107d 6620 Winfast DV2000 FireWire Controller + 1443 8024 FireBoard Blue + 1458 1000 GA-EP45-DS5 Motherboard 8025 TSB82AA2 IEEE-1394b Link Layer Controller 1458 1000 GA-K8N Ultra-9 Mainboard 8026 TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link) @@ -2936,6 +3122,8 @@ 803d PCIxx12 GemCore based SmartCard controller 103c 309f nx9420 103c 30a1 NC2400 + 103c 30a3 nc8430 + 103c 30aa nc6310 8101 TSB43DB42 IEEE-1394a-2000 Controller (PHY/Link) 8201 PCI1620 Firmware Loading Function 8204 PCI7410,7510,7610 PCI Firmware Loading Function @@ -2943,15 +3131,20 @@ 1028 014e Latitude D800 8231 XIO2000(A)/XIO2200(A) PCI Express-to-PCI Bridge 8235 XIO2200(A) IEEE-1394a-2000 Controller (PHY/Link) + 823e XIO2213A PCI Express to PCI Bridge + 823f XIO2213A 1394b OHCI with 3-Port PHY + 1546 803c FWB-PCIE1X11B 8400 ACX 100 22Mbps Wireless Interface 1186 3b00 DWL-650+ PC Card cardbus 22Mbs Wireless Adapter [AirPlus] 1186 3b01 DWL-520+ 22Mbps PCI Wireless Adapter + 1395 2201 WL22-PC 16ab 8501 WL-8305 IEEE802.11b+ Wireless LAN PCI Adapter 8401 ACX 100 22Mbps Wireless Interface 9000 Wireless Interface (of unknown type) 9065 TMS320DM642 9066 ACX 111 54Mbps Wireless Interface - 104c 9066 Trendnet TEW-421PC Wireless PCI Adapter + 104c 9066 WL212 Sitecom Wireless Network PCI-Card 100M (Version 1) + 104c 9096 Trendnet TEW-412PC Wireless PCI Adapter (Version A) 1186 3b04 DWL-G520+ Wireless PCI Adapter 1186 3b05 DWL-G650+ AirPlusG+ CardBus Wireless LAN 13d1 aba0 SWLMP-54108 108Mbps Wireless mini PCI card 802.11g+ @@ -2990,6 +3183,7 @@ ac22 PCI2032 PCI Docking Bridge ac23 PCI2250 PCI-to-PCI Bridge ac28 PCI2050 PCI-to-PCI Bridge + ac2c PCI2060 PCI-to-PCI Bridge ac30 PCI1260 PC card Cardbus Controller ac40 PCI4450 PC card Cardbus Controller ac41 PCI4410 PC card Cardbus Controller @@ -3006,9 +3200,13 @@ 1028 0139 Latitude D400 1028 013f Precision M60 1028 014e Latitude D800 + ac48 PCI7610 PC Card Cardbus Controller + ac49 PCI7410 PC Card Cardbus Controller ac4a PCI7510,7610 PC card Cardbus Controller 1028 0139 Latitude D400 1028 014e Latitude D800 + ac4b PCI7610 SD/MMC controller + ac4c PCI7610 Memory Stick controller ac50 PCI1410 PC card Cardbus Controller ac51 PCI1420 PC card Cardbus Controller 0e11 004e Evo N600c @@ -3034,6 +3232,10 @@ 175c 6100 ASI61xx Audio Adapter 175c 6200 ASI62xx Audio Adapter 175c 8800 ASI88xx Audio Adapter + 186f 3001 WR-G303 PCI radio receiver + 186f 3005 WR-G305 PCI radio receiver + 186f 3101 WR-G313 PCI radio receiver + 186f 3105 WR-G315 PCI radio receiver ac8d PCI 7620 ac8e PCI7420 CardBus Controller 1028 018d Inspiron 700m/710m @@ -3088,11 +3290,14 @@ 3012 ColdFusion 3e Chipset Memory Controller Hub 3017 Unassigned Hitachi Shared FC Device 3017 301d PCIe-to-PCIe Bridge with Virtualization IO Assist Feature + 3505 SH7751 PCI Controller (PCIC) + 350e SH7751R PCI Controller (PCIC) 1055 Efar Microsystems 9130 SLC90E66 [Victory66] IDE 9460 SLC90E66 [Victory66] ISA 9462 SLC90E66 [Victory66] USB [... truncated: 5464 lines follow ...] From korli at mail.berlios.de Fri Dec 5 21:05:52 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Fri, 5 Dec 2008 21:05:52 +0100 Subject: [Haiku-commits] r28780 - haiku/trunk/src/add-ons/kernel/drivers/audio/hda Message-ID: <200812052005.mB5K5q53008147@sheep.berlios.de> Author: korli Date: 2008-12-05 21:05:51 +0100 (Fri, 05 Dec 2008) New Revision: 28780 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28780&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp Log: added missing label Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp 2008-12-05 19:08:21 UTC (rev 28779) +++ haiku/trunk/src/add-ons/kernel/drivers/audio/hda/hda_multi_audio.cpp 2008-12-05 20:05:51 UTC (rev 28780) @@ -314,6 +314,8 @@ return "CD"; case PIN_DEV_HEAD_PHONE_OUT: return "Headphones"; + case PIN_DEV_SPEAKER: + return "Speaker"; } TRACE("couldn't find a string for widget %ld in hda_find_multi_custom_string()\n", widget.node_id); return NULL; From bonefish at mail.berlios.de Sat Dec 6 19:42:34 2008 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sat, 6 Dec 2008 19:42:34 +0100 Subject: [Haiku-commits] r28781 - haiku/trunk Message-ID: <200812061842.mB6IgY4l012740@sheep.berlios.de> Author: bonefish Date: 2008-12-06 19:42:33 +0100 (Sat, 06 Dec 2008) New Revision: 28781 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28781&view=rev Modified: haiku/trunk/Jamfile Log: Missed to check this one in: * Invoke the UserBuildConfigRulePostBuildTargets rule. * Some automatic whitespace cleanup. Modified: haiku/trunk/Jamfile =================================================================== --- haiku/trunk/Jamfile 2008-12-05 20:05:51 UTC (rev 28780) +++ haiku/trunk/Jamfile 2008-12-06 18:42:33 UTC (rev 28781) @@ -38,10 +38,10 @@ raw route ipv4 icmp udp tcp libnet.so libnetapi.so libbind.so libsocket.so ping ifconfig route traceroute arp pppconfig - + # network drivers: - sis900 rtl8139 rtl8169 via-rhine ipro1000 wb840 bcm440x bcm570x - + sis900 rtl8139 rtl8169 via-rhine ipro1000 wb840 bcm440x bcm570x + # PPP devices: modem pppoe # PPP protocols: @@ -53,29 +53,29 @@ # Pseudo-target to build the media stuffs only NotFile MediaKit ; Depends MediaKit : - libmedia.so + libmedia.so libgame.so # Servers - media_addon_server + media_addon_server media_server # Preference Sounds Media - + # Deskbar replicant desklink # add-ons - mixer.media_addon - tone_producer_demo.media_addon + mixer.media_addon + tone_producer_demo.media_addon video_producer_demo.media_addon legacy.media_addon multi_audio.media_addon # reader.media_addon # writer.media_addon -# demultiplexer.media_addon +# demultiplexer.media_addon # codecs ac3_decoder @@ -111,7 +111,7 @@ # Preferences Keymap Keyboard - Mouse + Mouse ; # Pseudo-target to build the OpenGL kit only @@ -151,6 +151,9 @@ # reset subdir SubDir HAIKU_TOP ; +# Execute post-build-target user config rules. +UserBuildConfigRulePostBuildTargets ; + # specify the Haiku image and network boot archive contents include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuImage ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) NetBootArchive ] ; From korli at mail.berlios.de Mon Dec 8 21:50:17 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 8 Dec 2008 21:50:17 +0100 Subject: [Haiku-commits] r28782 - haiku/trunk/src/add-ons/input_server/devices/keyboard Message-ID: <200812082050.mB8KoHr4010897@sheep.berlios.de> Author: korli Date: 2008-12-08 21:50:16 +0100 (Mon, 08 Dec 2008) New Revision: 28782 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28782&view=rev Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp Log: * use the keymap control and command keys to trigger the team monitor * this fixes part of #3176 Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp =================================================================== --- haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp 2008-12-06 18:42:33 UTC (rev 28781) +++ haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp 2008-12-08 20:50:16 UTC (rev 28782) @@ -636,8 +636,8 @@ } if (isKeyDown && keycode == 0x34 // DELETE KEY - && (states[0x5c >> 3] & (1 << (7 - (0x5c & 0x7)))) - && (states[0x5d >> 3] & (1 << (7 - (0x5d & 0x7))))) { + && (states[fCommandKey >> 3] & (1 << (7 - (fCommandKey & 0x7)))) + && (states[fControlKey >> 3] & (1 << (7 - (fControlKey & 0x7))))) { LOG_EVENT("TeamMonitor called\n"); // show the team monitor @@ -825,6 +825,8 @@ fKeymap.LoadCurrent(); fModifiers = fKeymap.Locks(); _UpdateLEDs(); + fControlKey = fKeymap.KeyForModifier(B_LEFT_CONTROL_KEY); + fCommandKey = fKeymap.KeyForModifier(B_LEFT_COMMAND_KEY); } } From anevilyak at gmail.com Mon Dec 8 23:41:05 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Mon, 8 Dec 2008 16:41:05 -0600 Subject: [Haiku-commits] r28782 Message-ID: Hi Jerome, I think you might have forgotten some files in this checkin, the code calls KeyMap::KeyForModifier() which doesn't seem to be present in the version in the repository, and also fCommandKey / fControlKey are undefined in the KeyboardDevice class. Regards, Rene From oruizdorantes at mail.berlios.de Mon Dec 8 23:49:20 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Mon, 8 Dec 2008 23:49:20 +0100 Subject: [Haiku-commits] r28784 - in haiku/trunk: headers/private/bluetooth src/servers/bluetooth Message-ID: <200812082249.mB8MnKNd027863@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-08 23:49:20 +0100 (Mon, 08 Dec 2008) New Revision: 28784 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28784&view=rev Modified: haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h haiku/trunk/src/servers/bluetooth/BluetoothServer.cpp haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp Log: Remove dedicated implementation of GetAddress and GetName in server side. Modified: haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h =================================================================== --- haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h 2008-12-08 22:45:25 UTC (rev 28783) +++ haiku/trunk/headers/private/bluetooth/bluetoothserver_p.h 2008-12-08 22:49:20 UTC (rev 28784) @@ -9,8 +9,6 @@ // LocalDevice #define BT_MSG_COUNT_LOCAL_DEVICES 'btCd' #define BT_MSG_ACQUIRE_LOCAL_DEVICE 'btAd' -#define BT_MSG_GET_FRIENDLY_NAME 'btFn' -#define BT_MSG_GET_ADDRESS 'btGa' #define BT_MSG_HANDLE_SIMPLE_REQUEST 'btsR' #define BT_MSG_ADD_DEVICE 'btDD' Modified: haiku/trunk/src/servers/bluetooth/BluetoothServer.cpp =================================================================== --- haiku/trunk/src/servers/bluetooth/BluetoothServer.cpp 2008-12-08 22:45:25 UTC (rev 28783) +++ haiku/trunk/src/servers/bluetooth/BluetoothServer.cpp 2008-12-08 22:49:20 UTC (rev 28784) @@ -119,16 +119,14 @@ message->FindString("name", &str); BPath path(str.String()); - (Output::Instance()->Post( str.String(), BLACKBOARD_GENERAL)); - (Output::Instance()->Post(" requested LocalDevice\n", BLACKBOARD_GENERAL)); + (Output::Instance()->Postf(BLACKBOARD_GENERAL, "Requested LocalDevice %s\n", str.String())); LocalDeviceImpl* ldi = LocalDeviceImpl::CreateTransportAccessor(&path); if (ldi->GetID() >= 0) { fLocalDevicesList.AddItem(ldi); Output::Instance()->AddTab("Local Device", BLACKBOARD_LD(ldi->GetID())); - (Output::Instance()->Post( str.String(), BLACKBOARD_LD(ldi->GetID()))); - (Output::Instance()->Post(" LocalDevice added\n", BLACKBOARD_LD(ldi->GetID()))); + (Output::Instance()->Postf(BLACKBOARD_LD(ldi->GetID()), "LocalDevice %s id=%x added\n", str.String(), ldi->GetID())); } else { @@ -149,14 +147,6 @@ status = HandleAcquireLocalDevice(message, &reply); break; - case BT_MSG_GET_FRIENDLY_NAME: - status = HandleGetFriendlyName(message, &reply); - break; - - case BT_MSG_GET_ADDRESS: - status = HandleGetAddress(message, &reply); - break; - case BT_MSG_HANDLE_SIMPLE_REQUEST: status = HandleSimpleRequest(message, &reply); break; @@ -271,9 +261,10 @@ bdaddr_t local; ldi = fLocalDevicesList.ItemAt(index); - if ((ldi->GetAddress(&local, message) == B_OK) && bacmp(&local, &bdaddr)) { - break; - } + // TODO: Only if the property is available + //if ((ldi->GetAddress(&local, message) == B_OK) && bacmp(&local, &bdaddr)) { + // break; + //} } } else @@ -306,45 +297,6 @@ status_t -BluetoothServer::HandleGetFriendlyName(BMessage* message, BMessage* reply) -{ - LocalDeviceImpl* ldi = LocateDelegateFromMessage(message); - BString name; - - if (ldi == NULL) - return B_ERROR; - - /* If the device was ocupied... Autlock?->LocalDeviceImpl will decide */ - if (ldi->GetFriendlyName(name, DetachCurrentMessage()) == B_OK) { - - return reply->AddString("friendlyname", name); - } - - return B_WOULD_BLOCK; -} - - -status_t -BluetoothServer::HandleGetAddress(BMessage* message, BMessage* reply) -{ - LocalDeviceImpl* ldi = LocateDelegateFromMessage(message); - bdaddr_t bdaddr; - - if (ldi == NULL) - return B_ERROR; - - /* If the device was ocupied... Autlock?->LocalDeviceImpl will decide */ - status_t status = ldi->GetAddress(&bdaddr, DetachCurrentMessage()); - if ( status == B_OK) { - - return reply->AddData("bdaddr", B_ANY_TYPE, &bdaddr, sizeof(bdaddr_t)); - } - - return status; -} - - -status_t BluetoothServer::HandleSimpleRequest(BMessage* message, BMessage* reply) { Modified: haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp =================================================================== --- haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp 2008-12-08 22:45:25 UTC (rev 28783) +++ haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp 2008-12-08 22:49:20 UTC (rev 28784) @@ -620,72 +620,6 @@ status_t -LocalDeviceImpl::GetAddress(bdaddr_t* bdaddr, BMessage* request) -{ - ssize_t ssize; - - if (fProperties->FindData("bdaddr", B_ANY_TYPE, 0, (const void **)bdaddr, &ssize) == B_OK) { - - - /* We have this info, returning back */ - return B_OK; - - } else { - size_t size; - - void* command = buildReadBdAddr(&size); - - /* Adding a wanted event in the queue */ - request->AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); - request->AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM, OCF_READ_BD_ADDR)); - - AddWantedEvent(request); - request->PrintToStream(); - - if (((HCITransportAccessor*)fHCIDelegate)->IssueCommand(command, size) == B_ERROR) - (Output::Instance()->Post("Command issue error\n", BLACKBOARD_EVENTS)); - - (Output::Instance()->Post("Command issued for GetAddress\n", BLACKBOARD_EVENTS)); - return B_WOULD_BLOCK; - } - -} - - -status_t -LocalDeviceImpl::GetFriendlyName(BString str, BMessage* request) -{ - - if (fProperties->FindString("friendlyname", &str) == B_OK) { - - (Output::Instance()->Post("Friendly name already present in server\n", BLACKBOARD_EVENTS)); - /* We have this info, returning back */ - return B_OK; - - } else { - size_t size; - - void* command = buildReadLocalName(&size); - - /* Adding a wanted event in the queue */ - request->AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); - request->AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_LOCAL_NAME)); - - AddWantedEvent(request); - request->PrintToStream(); - - if (((HCITransportAccessor*)fHCIDelegate)->IssueCommand(command, size) == B_ERROR) - (Output::Instance()->Post("Command issue error\n", BLACKBOARD_EVENTS)); - - (Output::Instance()->Post("Command issued for GetFriendlyname\n", BLACKBOARD_EVENTS)); - - return B_WOULD_BLOCK; - } - -} - - -status_t LocalDeviceImpl::ProcessSimpleRequest(BMessage* request) { ssize_t size; From oruizdorantes at mail.berlios.de Mon Dec 8 23:45:26 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Mon, 8 Dec 2008 23:45:26 +0100 Subject: [Haiku-commits] r28783 - haiku/trunk/src/kits/bluetooth Message-ID: <200812082245.mB8MjQJZ026764@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-08 23:45:25 +0100 (Mon, 08 Dec 2008) New Revision: 28783 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28783&view=rev Modified: haiku/trunk/src/kits/bluetooth/LocalDevice.cpp Log: GetAddress and GetFriendlyName does not need a dedicated request in the server side Modified: haiku/trunk/src/kits/bluetooth/LocalDevice.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/LocalDevice.cpp 2008-12-08 20:50:16 UTC (rev 28782) +++ haiku/trunk/src/kits/bluetooth/LocalDevice.cpp 2008-12-08 22:45:25 UTC (rev 28783) @@ -180,29 +180,32 @@ LocalDevice::GetBluetoothAddress() { if (fMessenger == NULL) - return bdaddrUtils::NullAddress(); + return bdaddrUtils::LocalAddress(); + size_t size; + void* command = buildReadBdAddr(&size); + + if (command == NULL) + return bdaddrUtils::LocalAddress(); + const bdaddr_t* bdaddr; - BMessage request(BT_MSG_GET_ADDRESS); + BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST); BMessage reply; - ssize_t size; - + ssize_t ssize; + /* ADD ID */ request.AddInt32("hci_id", hid); + request.AddData("raw command", B_ANY_TYPE, command, size); + request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); + request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM, OCF_READ_BD_ADDR)); + if (fMessenger->SendMessage(&request, &reply) == B_OK) { - - if (reply.FindData("bdaddr", B_ANY_TYPE, 0, (const void**)&bdaddr, &size) == B_OK ){ - + if (reply.FindData("bdaddr", B_ANY_TYPE, 0, (const void**)&bdaddr, &ssize) == B_OK ) return *bdaddr; - - } else { - return bdaddrUtils::NullAddress(); - } - } - return bdaddrUtils::NullAddress(); + return bdaddrUtils::LocalAddress(); } @@ -210,22 +213,30 @@ LocalDevice::GetFriendlyName() { if (fMessenger == NULL) - return NULL; + return BString("Unknown|Messenger"); + size_t size; + void* command = buildReadLocalName(&size); + if (command == NULL) + return BString("Unknown|NoMemory"); + BString friendlyname; - BMessage request(BT_MSG_GET_FRIENDLY_NAME); + BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST); BMessage reply; - /* ADD ID */ + request.AddInt32("hci_id", hid); - + request.AddData("raw command", B_ANY_TYPE, command, size); + request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); + request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_LOCAL_NAME)); + if (fMessenger->SendMessage(&request, &reply) == B_OK && reply.FindString("friendlyname", &friendlyname) == B_OK){ return friendlyname; } - return BString("Unknown"); + return BString("Unknown|ServerFailed"); } From anevilyak at mail.berlios.de Tue Dec 9 03:50:26 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 9 Dec 2008 03:50:26 +0100 Subject: [Haiku-commits] r28785 - in haiku/trunk/src: preferences/screen servers/app Message-ID: <200812090250.mB92oQJ5005066@sheep.berlios.de> Author: anevilyak Date: 2008-12-09 03:50:23 +0100 (Tue, 09 Dec 2008) New Revision: 28785 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28785&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp haiku/trunk/src/servers/app/Desktop.cpp haiku/trunk/src/servers/app/Desktop.h haiku/trunk/src/servers/app/Screen.cpp haiku/trunk/src/servers/app/ServerApp.cpp haiku/trunk/src/servers/app/VirtualScreen.cpp haiku/trunk/src/servers/app/WorkspacesView.cpp Log: Implement the missing pieces to handle per workspace display mode support. Adjust Workspace view to correctly scale each workspace based on the resolution of that workspace. This exposes one or two anomalies in other places in the app_server code though which I wasn't able to track down. This fixes ticket #693. Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2008-12-08 22:49:20 UTC (rev 28784) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2008-12-09 02:50:23 UTC (rev 28785) @@ -246,12 +246,8 @@ BMenuItem *item = new BMenuItem("Current Workspace", new BMessage(WORKSPACE_CHECK_MSG)); - // TODO: since per workspace settings is unimplemented (Ticket #693) - // we force the menu to "All Workspaces" for now - fAllWorkspacesItem->SetMarked(true); - item->SetEnabled(false); - popUpMenu->AddItem(item); + fAllWorkspacesItem->SetMarked(true); BMenuField* workspaceMenuField = new BMenuField(BRect(0, 0, 100, 15), "WorkspaceMenu", NULL, popUpMenu, true); @@ -1008,7 +1004,8 @@ void ScreenWindow::_CheckApplyEnabled() { - fApplyButton->SetEnabled(fSelected != fActive); + fApplyButton->SetEnabled(fSelected != fActive + || fAllWorkspacesItem->IsMarked()); fRevertButton->SetEnabled(count_workspaces() != fOriginalWorkspaceCount || fSelected != fOriginal); } Modified: haiku/trunk/src/servers/app/Desktop.cpp =================================================================== --- haiku/trunk/src/servers/app/Desktop.cpp 2008-12-08 22:49:20 UTC (rev 28784) +++ haiku/trunk/src/servers/app/Desktop.cpp 2008-12-09 02:50:23 UTC (rev 28785) @@ -879,6 +879,29 @@ /*! + Returns the virtual screen frame of the workspace specified by \a index. +*/ +BRect +Desktop::WorkspaceFrame(int32 index) const +{ + BRect frame; + if (index == fCurrentWorkspace) + frame = fVirtualScreen.Frame(); + else if (index >= 0 && index < fSettings->WorkspacesCount()) { + BMessage screenData; + int32 width; + int32 height; + fSettings->WorkspacesMessage(index)->FindMessage("screen", &screenData); + if (screenData.FindInt32("width", &width) != B_OK || screenData.FindInt32("height", &height) != B_OK) + frame = fVirtualScreen.Frame(); + else + frame.Set(0.0, 0.0, width - 1, height - 1); + } + return frame; +} + + +/*! Changes the current workspace to the one specified by \a index. */ void @@ -913,7 +936,6 @@ _SendFakeMouseMoved(); } - /*! Changes the current workspace to the one specified by \a index. You must hold the all window lock when calling this method. */ @@ -923,6 +945,13 @@ int32 previousIndex = fCurrentWorkspace; rgb_color previousColor = fWorkspaces[fCurrentWorkspace].Color(); bool movedMouseEventWindow = false; + display_mode previousMode, newMode; + fVirtualScreen.ScreenAt(0)->GetMode(&previousMode); + fVirtualScreen.RestoreConfiguration(*this, fSettings->WorkspacesMessage(index)); + fVirtualScreen.ScreenAt(0)->GetMode(&newMode); + // We only need to invalidate the entire desktop if we changed display modes + if (memcmp(&previousMode, &newMode, sizeof(display_mode))) + ScreenChanged(fVirtualScreen.ScreenAt(0), false); if (fMouseEventWindow != NULL) { if (fMouseEventWindow->IsNormal()) { @@ -1095,7 +1124,8 @@ BRegion dirty(screen->Frame()); // update our cached screen region fScreenRegion.Set(screen->Frame()); - + gInputManager->UpdateScreenBounds(screen->Frame()); + BRegion background; _RebuildClippingForAllWindows(background); @@ -1122,17 +1152,28 @@ fVirtualScreen.UpdateFrame(); if (makeDefault) { + StoreConfiguration(fCurrentWorkspace); + } +} + + +status_t +Desktop::StoreConfiguration(int32 workspace) +{ + if (workspace >= 0 && workspace < fSettings->WorkspacesCount()) { // store settings BMessage settings; fVirtualScreen.StoreConfiguration(settings); - fWorkspaces[fCurrentWorkspace].StoreConfiguration(settings); + fWorkspaces[workspace].StoreConfiguration(settings); - fSettings->SetWorkspacesMessage(fCurrentWorkspace, settings); + fSettings->SetWorkspacesMessage(workspace, settings); fSettings->Save(kWorkspacesSettings); + return B_OK; } + + return B_BAD_VALUE; } - // #pragma mark - Methods for Window manipulation Modified: haiku/trunk/src/servers/app/Desktop.h =================================================================== --- haiku/trunk/src/servers/app/Desktop.h 2008-12-08 22:49:20 UTC (rev 28784) +++ haiku/trunk/src/servers/app/Desktop.h 2008-12-09 02:50:23 UTC (rev 28785) @@ -91,12 +91,11 @@ void GetLastMouseState(BPoint* position, int32* buttons) const; // for use by ServerWindow - void ScreenChanged(Screen* screen, bool makeDefault); - void ScreenRemoved(Screen* screen) {} void ScreenAdded(Screen* screen) {} bool ReleaseScreen(Screen* screen) { return false; } + status_t StoreConfiguration(int32 workspace); const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; } DrawingEngine* GetDrawingEngine() const @@ -113,6 +112,7 @@ Workspace::Private& WorkspaceAt(int32 index) { return fWorkspaces[index]; } status_t SetWorkspacesCount(int32 newCount); + BRect WorkspaceFrame(int32 index) const; // Window methods Modified: haiku/trunk/src/servers/app/Screen.cpp =================================================================== --- haiku/trunk/src/servers/app/Screen.cpp 2008-12-08 22:49:20 UTC (rev 28784) +++ haiku/trunk/src/servers/app/Screen.cpp 2008-12-09 02:50:23 UTC (rev 28785) @@ -22,7 +22,6 @@ #include #include - static float get_mode_frequency(const display_mode& mode) { @@ -91,6 +90,12 @@ status_t Screen::SetMode(const display_mode& mode, bool makeDefault) { + display_mode current; + GetMode(¤t); + current.flags = mode.flags; + if (!memcmp(&mode, ¤t, sizeof(display_mode))) + return B_OK; + gBitmapManager->SuspendOverlays(); status_t status = fHWInterface->SetMode(mode); @@ -162,7 +167,6 @@ * mode.timing.v_total / 10 * int32(frequency * 10)) / 1000; adjusted = true; } - status = SetMode(mode, false); if (status < B_OK && adjusted) { // try again with the unchanged mode Modified: haiku/trunk/src/servers/app/ServerApp.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerApp.cpp 2008-12-08 22:49:20 UTC (rev 28784) +++ haiku/trunk/src/servers/app/ServerApp.cpp 2008-12-09 02:50:23 UTC (rev 28785) @@ -2167,7 +2167,6 @@ // 2) workspace index // 3) display_mode to set // 4) 'makeDefault' boolean - // TODO: See above: workspaces support, etc. screen_id id; link.Read(&id); @@ -2183,15 +2182,27 @@ if (status == B_OK && fDesktop->LockAllWindows()) { display_mode oldMode; - fDesktop->ScreenAt(0)->GetMode(&oldMode); - if (memcmp(&oldMode, &mode, sizeof(display_mode))) { - status = fDesktop->ScreenAt(0)->SetMode(mode, makeDefault); - if (status == B_OK) { - gInputManager->UpdateScreenBounds(fDesktop->ScreenAt(0)->Frame()); - fDesktop->ScreenChanged(fDesktop->ScreenAt(0), makeDefault); - } - } else - status = B_OK; + if (workspace == (uint32)fDesktop->CurrentWorkspace()) { + fDesktop->ScreenAt(0)->GetMode(&oldMode); + if (memcmp(&oldMode, &mode, sizeof(display_mode))) { + status = fDesktop->ScreenAt(0)->SetMode(mode, makeDefault); + if (status == B_OK) { + fDesktop->ScreenChanged(fDesktop->ScreenAt(0), makeDefault); + } + } else + status = B_OK; + } else { + // this is perhaps not ideal - it assumes that if the + // workspace is not the active one, then pull the + // configuration from active and store it to the specified + // workspace. This is safer since it's assumed that the + // active workspace has a display mode that's usable, + // but at the same time the API implies that you can set + // a non-visible workspace to whatever mode you like + // TODO: decide what to do here. + if (makeDefault) + fDesktop->StoreConfiguration(workspace); + } fDesktop->UnlockAllWindows(); } else status = B_ERROR; Modified: haiku/trunk/src/servers/app/VirtualScreen.cpp =================================================================== --- haiku/trunk/src/servers/app/VirtualScreen.cpp 2008-12-08 22:49:20 UTC (rev 28784) +++ haiku/trunk/src/servers/app/VirtualScreen.cpp 2008-12-09 02:50:23 UTC (rev 28785) @@ -167,6 +167,7 @@ fDrawingEngine = screen->GetDrawingEngine(); fHWInterface = screen->HWInterface(); fFrame = screen->Frame(); + item->frame = fFrame; fScreenList.AddItem(item); Modified: haiku/trunk/src/servers/app/WorkspacesView.cpp =================================================================== --- haiku/trunk/src/servers/app/WorkspacesView.cpp 2008-12-08 22:49:20 UTC (rev 28784) +++ haiku/trunk/src/servers/app/WorkspacesView.cpp 2008-12-09 02:50:23 UTC (rev 28785) @@ -80,7 +80,7 @@ BRect WorkspacesView::_ScreenFrame(int32 i) { - return Window()->Desktop()->VirtualScreen().Frame(); + return Window()->Desktop()->WorkspaceFrame(i); } From anevilyak at mail.berlios.de Tue Dec 9 06:37:37 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 9 Dec 2008 06:37:37 +0100 Subject: [Haiku-commits] r28786 - haiku/trunk/src/apps/aboutsystem Message-ID: <200812090537.mB95bb0A008158@sheep.berlios.de> Author: anevilyak Date: 2008-12-09 06:37:35 +0100 (Tue, 09 Dec 2008) New Revision: 28786 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28786&view=rev Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Make the uptime view a multiline textview. This allows it to gracefully wrap the text instead of simply cutting it off when your uptime is too long to fit into the provided space. Fixes ticket #701. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-12-09 02:50:23 UTC (rev 28785) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2008-12-09 05:37:35 UTC (rev 28786) @@ -100,7 +100,7 @@ void _AddCopyrightsFromAttribute(); BStringView *fMemView; - BStringView *fUptimeView; + BTextView *fUptimeView; BView *fInfoView; HyperTextView *fCreditsView; @@ -333,9 +333,13 @@ stringView->ResizeToPreferred(); r.OffsetBy(0, labelHeight); - r.bottom = r.top + textHeight; + r.bottom = r.top + textHeight * 3; - fUptimeView = new BStringView(r, "uptimetext", ""); + fUptimeView = new BTextView(r, "uptimetext", r.OffsetToCopy(0,0), B_FOLLOW_ALL); + fUptimeView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + fUptimeView->MakeEditable(false); + fUptimeView->MakeSelectable(false); + fUptimeView->SetWordWrap(true); fInfoView->AddChild(fUptimeView); // string width changes, so we don't do ResizeToPreferred() From axeld at mail.berlios.de Tue Dec 9 23:23:37 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 9 Dec 2008 23:23:37 +0100 Subject: [Haiku-commits] r28787 - haiku/trunk/src/system/kernel/fs Message-ID: <200812092223.mB9MNb1A029513@sheep.berlios.de> Author: axeld Date: 2008-12-09 23:23:36 +0100 (Tue, 09 Dec 2008) New Revision: 28787 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28787&view=rev Modified: haiku/trunk/src/system/kernel/fs/node_monitor.cpp Log: While looking at the code, I found two memory leaks: * UpdateUserListener() did not delete the copiedListener in case adding the monitor listener failed. * RemoveListener() did never delete UserNodeListeners, IOW user node monitors were never freed! Modified: haiku/trunk/src/system/kernel/fs/node_monitor.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2008-12-09 05:37:35 UTC (rev 28786) +++ haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2008-12-09 22:23:36 UTC (rev 28787) @@ -268,6 +268,12 @@ monitor->listeners.Remove(listener); list_remove_link(listener); + if (dynamic_cast(listener->listener) != NULL) { + // This is a listener we copied ourselves in UpdateUserListener(), + // so we have to delete it here. + delete listener->listener; + } + delete listener; if (monitor->listeners.IsEmpty()) @@ -907,7 +913,12 @@ return B_NO_MEMORY; } - return _AddMonitorListener(context, monitor, flags, *copiedListener); + status_t status = _AddMonitorListener(context, monitor, flags, + *copiedListener); + if (status != B_OK) + delete copiedListener; + + return status; } From anevilyak at mail.berlios.de Tue Dec 9 23:36:01 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 9 Dec 2008 23:36:01 +0100 Subject: [Haiku-commits] r28788 - haiku/trunk/src/system/kernel/fs Message-ID: <200812092236.mB9Ma15P030466@sheep.berlios.de> Author: anevilyak Date: 2008-12-09 23:36:00 +0100 (Tue, 09 Dec 2008) New Revision: 28788 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28788&view=rev Modified: haiku/trunk/src/system/kernel/fs/node_monitor.cpp Log: Build fix. Redeclaration of status variable. Modified: haiku/trunk/src/system/kernel/fs/node_monitor.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2008-12-09 22:23:36 UTC (rev 28787) +++ haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2008-12-09 22:36:00 UTC (rev 28788) @@ -913,7 +913,7 @@ return B_NO_MEMORY; } - status_t status = _AddMonitorListener(context, monitor, flags, + status = _AddMonitorListener(context, monitor, flags, *copiedListener); if (status != B_OK) delete copiedListener; From axeld at mail.berlios.de Wed Dec 10 00:09:59 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 10 Dec 2008 00:09:59 +0100 Subject: [Haiku-commits] r28789 - haiku/trunk/src/system/kernel/fs Message-ID: <200812092309.mB9N9xNl032560@sheep.berlios.de> Author: axeld Date: 2008-12-10 00:09:58 +0100 (Wed, 10 Dec 2008) New Revision: 28789 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28789&view=rev Modified: haiku/trunk/src/system/kernel/fs/node_monitor.cpp Log: * Minor cleanup - thanks, Rene, I just got aware of it. Modified: haiku/trunk/src/system/kernel/fs/node_monitor.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2008-12-09 22:36:00 UTC (rev 28788) +++ haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2008-12-09 23:09:58 UTC (rev 28789) @@ -913,8 +913,7 @@ return B_NO_MEMORY; } - status = _AddMonitorListener(context, monitor, flags, - *copiedListener); + status = _AddMonitorListener(context, monitor, flags, *copiedListener); if (status != B_OK) delete copiedListener; From axeld at mail.berlios.de Wed Dec 10 00:16:11 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 10 Dec 2008 00:16:11 +0100 Subject: [Haiku-commits] r28790 - in haiku/trunk: headers/private/net src/add-ons/kernel/network src/add-ons/kernel/network/notifications src/add-ons/kernel/network/stack Message-ID: <200812092316.mB9NGBM0000189@sheep.berlios.de> Author: axeld Date: 2008-12-10 00:16:10 +0100 (Wed, 10 Dec 2008) New Revision: 28790 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28790&view=rev Added: haiku/trunk/headers/private/net/net_notifications.h haiku/trunk/src/add-ons/kernel/network/notifications/ haiku/trunk/src/add-ons/kernel/network/notifications/Jamfile haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp Modified: haiku/trunk/src/add-ons/kernel/network/Jamfile haiku/trunk/src/add-ons/kernel/network/stack/Jamfile haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h Log: * Work-in-progress of a network notification implementation. * Compiles, but doesn't work at all yet. For those who wonder: the networking notifications are put into a separate module, so that the network stack can be unloaded without losing connection, IOW user applications will continue to retrieve notifications when the stack is loaded again. Added: haiku/trunk/headers/private/net/net_notifications.h =================================================================== --- haiku/trunk/headers/private/net/net_notifications.h 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/headers/private/net/net_notifications.h 2008-12-09 23:16:10 UTC (rev 28790) @@ -0,0 +1,65 @@ +/* + * Copyright 2008, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef NET_NOTIFICATIONS_H +#define NET_NOTIFICATIONS_H + + +#include + + +#define NET_NOTIFICATIONS_MODULE_NAME "network/notifications/v1" + +namespace BPrivate { + class KMessage; +}; + +struct net_notifications_module_info { + module_info info; + + void (*send_notification)(const BPrivate::KMessage* event); +}; + +// generic syscall interface +#define NET_NOTIFICATIONS_SYSCALLS "network/notifications" + +#define NET_NOTIFICATIONS_START_WATCHING 1 +#define NET_NOTIFICATIONS_STOP_WATCHING 2 + +struct net_notifications_control { + uint32 flags; + port_id port; + uint32 token; +}; + +// TODO: the following part of this header should end up in a public header +// some day! + +#define B_NETWORK_INTERFACE_ADDED 1 +#define B_NETWORK_INTERFACE_REMOVED 2 +#define B_NETWORK_INTERFACE_CHANGED 3 +#define B_NETWORK_DEVICE_LINK_CHANGED 4 +// TODO: add routes, stack unloaded/loaded, ... events + +enum { + B_WATCH_NETWORK_INTERFACE_CHANGES = 0x0001, + B_WATCH_NETWORK_LINK_CHANGES = 0x0002 +}; + +#define B_NETWORK_MONITOR '_NTN' + +#ifndef _KERNEL_MODE +# include + +status_t start_watching_network(uint32 flags, const BMessenger& target); +status_t start_watching_network(uint32 flags, const BHandler* handler, + const BLooper* looper = NULL); + +status_t stop_watching_network(const BMessenger& target); +status_t stop_watching_network(const BHandler* handler, + const BLooper* looper = NULL); + +#endif // _KERNEL_MODE + +#endif // NET_NOTIFICATIONS_H Modified: haiku/trunk/src/add-ons/kernel/network/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/network/Jamfile 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/src/add-ons/kernel/network/Jamfile 2008-12-09 23:16:10 UTC (rev 28790) @@ -2,5 +2,6 @@ SubInclude HAIKU_TOP src add-ons kernel network datalink_protocols ; SubInclude HAIKU_TOP src add-ons kernel network devices ; +SubInclude HAIKU_TOP src add-ons kernel network notifications ; SubInclude HAIKU_TOP src add-ons kernel network protocols ; SubInclude HAIKU_TOP src add-ons kernel network stack ; Added: haiku/trunk/src/add-ons/kernel/network/notifications/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/network/notifications/Jamfile 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/src/add-ons/kernel/network/notifications/Jamfile 2008-12-09 23:16:10 UTC (rev 28790) @@ -0,0 +1,8 @@ +SubDir HAIKU_TOP src add-ons kernel network notifications ; + +UseHeaders $(TARGET_PRIVATE_KERNEL_HEADERS) : true ; +UsePrivateHeaders net shared ; + +KernelAddon notifications : + notifications.cpp +; Added: haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp 2008-12-09 23:16:10 UTC (rev 28790) @@ -0,0 +1,309 @@ +/* + * Copyright 2008, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + */ + +/*! Provides the networking stack notification service. */ + +#include + +//#include +#include +#include + + +// TODO: add generic syscall interface + + +static UserMessagingMessageSender sNotificationSender; + +struct net_listener : public DoublyLinkedListLinkImpl { + ~net_listener(); + + uint32 flags; + NotificationListener* listener; +}; + +typedef DoublyLinkedList ListenerList; + +class UserNetListener : public UserMessagingListener { +public: + UserNetListener(port_id port, int32 token) + : UserMessagingListener(sNotificationSender, port, token) + { + } + + bool operator==(const NotificationListener& _other) const + { + const UserNetListener* other + = dynamic_cast(&_other); + return other != NULL && other->Port() == Port() + && other->Token() == Token(); + } +}; + +class NetNotificationService : public NotificationService { +public: + NetNotificationService(); + virtual ~NetNotificationService(); + + void Notify(const KMessage& event); + + status_t AddListener(const KMessage* eventSpecifier, + NotificationListener& listener); + status_t UpdateListener(const KMessage* eventSpecifier, + NotificationListener& listener); + status_t RemoveListener(const KMessage* eventSpecifier, + NotificationListener& listener); + + status_t RemoveUserListeners(port_id port, uint32 token); + status_t UpdateUserListener(uint32 flags, + port_id port, uint32 token); + + virtual const char* Name() { return "network"; } + +private: + status_t _AddListener(uint32 flags, + NotificationListener& listener); + + recursive_lock fRecursiveLock; + ListenerList fListeners; +}; + +static NetNotificationService sNotificationService; + + +net_listener::~net_listener() +{ + if (dynamic_cast(listener) != NULL) + delete listener; +} + + +// #pragma mark - NetNotificationService + + +NetNotificationService::NetNotificationService() +{ + recursive_lock_init(&fRecursiveLock, "net notifications"); +} + + +NetNotificationService::~NetNotificationService() +{ + recursive_lock_destroy(&fRecursiveLock); +} + + +/*! \brief Notifies all registered listeners. + \param event The message defining the event +*/ +void +NetNotificationService::Notify(const KMessage& event) +{ + uint32 flags = event.GetInt32("flags", 0); + if (flags == 0) + return; + + RecursiveLocker _(fRecursiveLock); + + ListenerList::Iterator iterator = fListeners.GetIterator(); + while (net_listener* listener = iterator.Next()) { + if ((listener->flags & flags) != 0) + listener->listener->EventOccured(*this, &event); + } + + iterator = fListeners.GetIterator(); + while (net_listener* listener = iterator.Next()) { + if ((listener->flags & flags) != 0) + listener->listener->AllListenersNotified(*this); + } +} + + +status_t +NetNotificationService::AddListener(const KMessage* eventSpecifier, + NotificationListener& listener) +{ + if (eventSpecifier == NULL) + return B_BAD_VALUE; + + uint32 flags = eventSpecifier->GetInt32("flags", 0); + + return _AddListener(flags, listener); +} + + +status_t +NetNotificationService::UpdateListener(const KMessage* eventSpecifier, + NotificationListener& notificationListener) +{ + if (eventSpecifier == NULL) + return B_BAD_VALUE; + + uint32 flags = eventSpecifier->GetInt32("flags", 0); + bool addFlags = eventSpecifier->GetBool("add flags", false); + + RecursiveLocker _(fRecursiveLock); + + ListenerList::Iterator iterator = fListeners.GetIterator(); + while (net_listener* listener = iterator.Next()) { + if (*listener->listener == notificationListener) { + if (addFlags) + listener->flags |= flags; + else + listener->flags = flags; + return B_OK; + } + } + + return B_ENTRY_NOT_FOUND; +} + + +status_t +NetNotificationService::RemoveListener(const KMessage* eventSpecifier, + NotificationListener& notificationListener) +{ + RecursiveLocker _(fRecursiveLock); + + ListenerList::Iterator iterator = fListeners.GetIterator(); + while (net_listener* listener = iterator.Next()) { + if (listener->listener == ¬ificationListener) { + iterator.Remove(); + delete listener; + return B_OK; + } + } + + return B_ENTRY_NOT_FOUND; +} + + +inline status_t +NetNotificationService::RemoveUserListeners(port_id port, uint32 token) +{ + UserNetListener userListener(port, token); + + RecursiveLocker _(fRecursiveLock); + + ListenerList::Iterator iterator = fListeners.GetIterator(); + while (net_listener* listener = iterator.Next()) { + if (*listener->listener == userListener) { + iterator.Remove(); + delete listener; + return B_OK; + } + } + + return B_ENTRY_NOT_FOUND; +} + + +status_t +NetNotificationService::UpdateUserListener(uint32 flags, port_id port, + uint32 token) +{ + UserNetListener userListener(port, token); + + RecursiveLocker _(fRecursiveLock); + + ListenerList::Iterator iterator = fListeners.GetIterator(); + while (net_listener* listener = iterator.Next()) { + if (*listener->listener == userListener) { + listener->flags |= flags; + return B_OK; + } + } + + UserNetListener* copiedListener = new(std::nothrow) UserNetListener( + userListener); + if (copiedListener == NULL) + return B_NO_MEMORY; + + status_t status = _AddListener(flags, *copiedListener); + if (status != B_OK) + delete copiedListener; + + return status; +} + + +status_t +NetNotificationService::_AddListener(uint32 flags, + NotificationListener& notificationListener) +{ + net_listener* listener = new(std::nothrow) net_listener; + if (listener == NULL) + return B_NO_MEMORY; + + listener->flags = flags; + listener->listener = ¬ificationListener; + + RecursiveLocker _(fRecursiveLock); + + fListeners.Add(listener); + return B_OK; +} + + +// #pragma mark - User generic syscall + + +status_t +_user_start_watching_network(uint32 flags, port_id port, uint32 token) +{ + return sNotificationService.UpdateUserListener(flags, port, token); +} + + +status_t +_user_stop_watching_network(port_id port, uint32 token) +{ + return sNotificationService.RemoveUserListeners(port, token); +} + + +// #pragma mark - exported module API + + +static void +send_notification(const KMessage* event) +{ + sNotificationService.Notify(*event); +} + + +static status_t +notifications_std_ops(int32 op, ...) +{ + switch (op) { + case B_MODULE_INIT: + new(&sNotificationSender) UserMessagingMessageSender(); + new(&sNotificationService) NetNotificationService(); + return B_OK; + case B_MODULE_UNINIT: + sNotificationSender.~UserMessagingMessageSender(); + sNotificationService.~NetNotificationService(); + return B_OK; + + default: + return B_ERROR; + } +} + + +net_notifications_module_info sNotificationsModule = { + { + NET_NOTIFICATIONS_MODULE_NAME, + 0, + notifications_std_ops + }, + + send_notification +}; + +module_info* modules[] = { + (module_info*)&sNotificationsModule, + NULL +}; Modified: haiku/trunk/src/add-ons/kernel/network/stack/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/Jamfile 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/src/add-ons/kernel/network/stack/Jamfile 2008-12-09 23:16:10 UTC (rev 28790) @@ -21,6 +21,7 @@ interfaces.cpp net_buffer.cpp net_socket.cpp + notifications.cpp link.cpp radix.c routes.cpp Added: haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp 2008-12-09 23:16:10 UTC (rev 28790) @@ -0,0 +1,100 @@ +/* + * Copyright 2008, Axel D?rfler, axeld at pinc-software.de. + * Distributed under the terms of the MIT License. + */ + +/*! Provides the stack internal notification API. + + The actual message sending happens in another module to make the + notification listeners independent from the stack status. +*/ + +#include + +#include + +#include "stack_private.h" + + +static net_notifications_module_info* sNotificationModule; + + +status_t +notify_interface_added(const char* interface) +{ + if (sNotificationModule == NULL) + return B_NOT_SUPPORTED; + + char messageBuffer[512]; + KMessage message; + message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); + message.AddInt32("opcode", B_NETWORK_INTERFACE_ADDED); + message.AddString("interface", interface); + + return sNotificationModule->send_notification(&message); +} + + +status_t +notify_interface_removed(const char* interface) +{ + if (sNotificationModule == NULL) + return B_NOT_SUPPORTED; + + char messageBuffer[512]; + KMessage message; + message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); + message.AddInt32("opcode", B_NETWORK_INTERFACE_REMOVED); + message.AddString("interface", interface); + + return sNotificationModule->send_notification(&message); +} + + +status_t +notify_interface_changed(const char* interface) +{ + if (sNotificationModule == NULL) + return B_NOT_SUPPORTED; + + char messageBuffer[512]; + KMessage message; + message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); + message.AddInt32("opcode", B_NETWORK_INTERFACE_CHANGED); + message.AddString("interface", interface); + + return sNotificationModule->send_notification(&message); +} + + +status_t +notify_link_changed(const char* interface) +{ + if (sNotificationModule == NULL) + return B_NOT_SUPPORTED; + + char messageBuffer[512]; + KMessage message; + message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); + message.AddInt32("opcode", B_NETWORK_DEVICE_LINK_CHANGED); + message.AddString("interface", interface); + + return sNotificationModule->send_notification(&message); +} + + +status_t +init_notifications() +{ + return get_module(NET_NOTIFICATIONS_MODULE_NAME, + (module_info**)&sNotificationModule); +} + + +void +uninit_notifications() +{ + if (sNotificationModule != NULL) + put_module(NET_NOTIFICATIONS_MODULE_NAME); + +} Modified: haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp 2008-12-09 23:16:10 UTC (rev 28790) @@ -753,6 +753,14 @@ if (status < B_OK) goto err2; + status = init_notifications(); + if (status < B_OK) { + // If this fails, it just means there won't be any notifications, + // it's not a fatal error. + dprintf("networking stack notifications could not be initialized: %s\n", + strerror(status)); + } + mutex_init(&sChainLock, "net chains"); mutex_init(&sInitializeChainLock, "net intialize chains"); @@ -827,6 +835,7 @@ uninit_timers(); uninit_interfaces(); uninit_domains(); + uninit_notifications(); mutex_destroy(&sChainLock); mutex_destroy(&sInitializeChainLock); Modified: haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h 2008-12-09 23:09:58 UTC (rev 28789) +++ haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h 2008-12-09 23:16:10 UTC (rev 28790) @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -33,6 +33,14 @@ status_t get_domain_datalink_protocols(net_interface *interface); status_t put_domain_datalink_protocols(net_interface *interface); +// notifications.cpp +status_t notify_interface_added(const char* interface); +status_t notify_interface_removed(const char* interface); +status_t notify_interface_changed(const char* interface); +status_t notify_link_changed(const char* interface); +status_t init_notifications(); +void uninit_notifications(); + status_t init_stack(); status_t uninit_stack(); From stippi at mail.berlios.de Wed Dec 10 00:33:19 2008 From: stippi at mail.berlios.de (stippi at mail.berlios.de) Date: Wed, 10 Dec 2008 00:33:19 +0100 Subject: [Haiku-commits] r28791 - in haiku/trunk/docs: userguide userguide/applications userguide/applications/apps-images userguide/desktop-applets userguide/desktop-applets/desktop-applets-images userguide/preferences userguide/preferences/prefs-images welcome welcome/html-dtd Message-ID: <200812092333.mB9NXJbN003927@sheep.berlios.de> Author: stippi Date: 2008-12-10 00:31:04 +0100 (Wed, 10 Dec 2008) New Revision: 28791 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28791&view=rev Added: haiku/trunk/docs/userguide/applications/ haiku/trunk/docs/userguide/applications/apps-activitymonitor.html haiku/trunk/docs/userguide/applications/apps-bepdf.html haiku/trunk/docs/userguide/applications/apps-cdplayer.html haiku/trunk/docs/userguide/applications/apps-codycam.html haiku/trunk/docs/userguide/applications/apps-deskcalc.html haiku/trunk/docs/userguide/applications/apps-diskprobe.html haiku/trunk/docs/userguide/applications/apps-diskusage.html haiku/trunk/docs/userguide/applications/apps-drivesetup.html haiku/trunk/docs/userguide/applications/apps-expander.html haiku/trunk/docs/userguide/applications/apps-firefox.html haiku/trunk/docs/userguide/applications/apps-icon-o-matic.html haiku/trunk/docs/userguide/applications/apps-images/ haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/activitymonitor.png haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/expander-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/expander-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/expander-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/firefox-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/firefox-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/firefox-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/icon-o-matic-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/icon-o-matic-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/icon-o-matic-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/installer-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/installer-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/installer-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/magnify-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/magnify-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/magnify-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/magnify.png haiku/trunk/docs/userguide/applications/apps-images/mail-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/mail-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/mail-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/mediaplayer-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/mediaplayer-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/mediaplayer-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/midiplayer-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/midiplayer-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/midiplayer-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/packageinstaller-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/packageinstaller-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/packageinstaller-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/pe-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/pe-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/pe-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/people-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/people-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/people-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/screenshot-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/screenshot-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/screenshot-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/showimage-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/showimage-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/showimage-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/soundrecorder-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/soundrecorder-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/soundrecorder-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/stylededit-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/stylededit-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/stylededit-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/stylededit.png haiku/trunk/docs/userguide/applications/apps-images/terminal-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/terminal-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/terminal-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/terminal.png haiku/trunk/docs/userguide/applications/apps-images/textsearch-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/textsearch-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/textsearch-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/tv-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/tv-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/tv-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/vision-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/vision-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/vision-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/vlc-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/vlc-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/vlc-icon_64.png haiku/trunk/docs/userguide/applications/apps-images/wonderbrush-icon_16.png haiku/trunk/docs/userguide/applications/apps-images/wonderbrush-icon_32.png haiku/trunk/docs/userguide/applications/apps-images/wonderbrush-icon_64.png haiku/trunk/docs/userguide/applications/apps-installer.html haiku/trunk/docs/userguide/applications/apps-magnify.html haiku/trunk/docs/userguide/applications/apps-mail.html haiku/trunk/docs/userguide/applications/apps-mediaplayer.html haiku/trunk/docs/userguide/applications/apps-midiplayer.html haiku/trunk/docs/userguide/applications/apps-packageinstaller.html haiku/trunk/docs/userguide/applications/apps-pe.html haiku/trunk/docs/userguide/applications/apps-people.html haiku/trunk/docs/userguide/applications/apps-screenshot.html haiku/trunk/docs/userguide/applications/apps-showimage.html haiku/trunk/docs/userguide/applications/apps-soundrecorder.html haiku/trunk/docs/userguide/applications/apps-stylededit.html haiku/trunk/docs/userguide/applications/apps-terminal.html haiku/trunk/docs/userguide/applications/apps-textsearch.html haiku/trunk/docs/userguide/applications/apps-tv.html haiku/trunk/docs/userguide/applications/apps-vision.html haiku/trunk/docs/userguide/applications/apps-vlc.html haiku/trunk/docs/userguide/applications/apps-wonderbrush.html haiku/trunk/docs/userguide/demos-images/ haiku/trunk/docs/userguide/desktop-applets/ haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/ haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/launchbox-icon_16.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/launchbox-icon_32.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/launchbox-icon_64.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/launchbox.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/networkstatus-icon_16.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/networkstatus-icon_32.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/networkstatus-icon_64.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/powerstatus-icon_16.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/powerstatus-icon_32.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/powerstatus-icon_64.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/processcontroller-icon_16.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/processcontroller-icon_32.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/processcontroller-icon_64.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/workspaces-icon_16.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/workspaces-icon_32.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-images/workspaces-icon_64.png haiku/trunk/docs/userguide/desktop-applets/desktop-applets-launchbox.html haiku/trunk/docs/userguide/desktop-applets/desktop-applets-networkstatus.html haiku/trunk/docs/userguide/desktop-applets/desktop-applets-processcontroller.html haiku/trunk/docs/userguide/preferences/ haiku/trunk/docs/userguide/preferences/prefs-appearance.html haiku/trunk/docs/userguide/preferences/prefs-backgrounds.html haiku/trunk/docs/userguide/preferences/prefs-datatranslations.html haiku/trunk/docs/userguide/preferences/prefs-e-mail.html haiku/trunk/docs/userguide/preferences/prefs-filetypes.html haiku/trunk/docs/userguide/preferences/prefs-fonts.html haiku/trunk/docs/userguide/preferences/prefs-images/ haiku/trunk/docs/userguide/preferences/prefs-images/appearance-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/appearance-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/appearance-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/backgrounds-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/backgrounds-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/backgrounds-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/datatranslations-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/datatranslations-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/datatranslations-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/e-mail-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/e-mail-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/e-mail-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/filetypes-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/filetypes-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/filetypes-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/fonts-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/fonts-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/fonts-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/keyboard-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/keyboard-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/keyboard-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/keymap-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/keymap-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/keymap-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/media-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/media-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/media-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/menu-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/menu-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/menu-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/mouse-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/mouse-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/mouse-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/network-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/network-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/network-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/printers-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/printers-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/printers-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/screen-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/screen-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/screen-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/screensaver-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/screensaver-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/screensaver-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/sounds-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/sounds-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/sounds-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/time-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/time-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/time-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-images/virtualmemory-icon_16.png haiku/trunk/docs/userguide/preferences/prefs-images/virtualmemory-icon_32.png haiku/trunk/docs/userguide/preferences/prefs-images/virtualmemory-icon_64.png haiku/trunk/docs/userguide/preferences/prefs-keyboard.html haiku/trunk/docs/userguide/preferences/prefs-keymap.html haiku/trunk/docs/userguide/preferences/prefs-media.html haiku/trunk/docs/userguide/preferences/prefs-menu.html haiku/trunk/docs/userguide/preferences/prefs-mouse.html haiku/trunk/docs/userguide/preferences/prefs-network.html haiku/trunk/docs/userguide/preferences/prefs-printers.html haiku/trunk/docs/userguide/preferences/prefs-screen.html haiku/trunk/docs/userguide/preferences/prefs-screensaver.html haiku/trunk/docs/userguide/preferences/prefs-sounds.html haiku/trunk/docs/userguide/preferences/prefs-time.html haiku/trunk/docs/userguide/preferences/prefs-virtualmemory.html haiku/trunk/docs/welcome/html-dtd/ haiku/trunk/docs/welcome/html-dtd/xhtml-lat1.ent haiku/trunk/docs/welcome/html-dtd/xhtml-special.ent haiku/trunk/docs/welcome/html-dtd/xhtml-symbol.ent haiku/trunk/docs/welcome/html-dtd/xhtml1-frameset.dtd haiku/trunk/docs/welcome/html-dtd/xhtml1-strict.dtd haiku/trunk/docs/welcome/html-dtd/xhtml1-transitional.dtd Removed: haiku/trunk/docs/userguide/prefs-appearance.html haiku/trunk/docs/userguide/prefs-backgrounds.html haiku/trunk/docs/userguide/prefs-datatranslations.html haiku/trunk/docs/userguide/prefs-e-mail.html haiku/trunk/docs/userguide/prefs-filetypes.html haiku/trunk/docs/userguide/prefs-fonts.html haiku/trunk/docs/userguide/prefs-images/ haiku/trunk/docs/userguide/prefs-keyboard.html haiku/trunk/docs/userguide/prefs-keymap.html haiku/trunk/docs/userguide/prefs-menu.html haiku/trunk/docs/userguide/prefs-mouse.html haiku/trunk/docs/userguide/prefs-network.html haiku/trunk/docs/userguide/prefs-screen.html haiku/trunk/docs/userguide/prefs-screensaver.html haiku/trunk/docs/userguide/prefs-sounds.html haiku/trunk/docs/userguide/prefs-time.html haiku/trunk/docs/userguide/prefs-virtualmemory.html Modified: haiku/trunk/docs/userguide/applications.html haiku/trunk/docs/userguide/attributes.html haiku/trunk/docs/userguide/bootloader.html haiku/trunk/docs/userguide/contents.html haiku/trunk/docs/userguide/demos.html haiku/trunk/docs/userguide/deskbar.html haiku/trunk/docs/userguide/desktop-applets.html haiku/trunk/docs/userguide/filesystem-layout.html haiku/trunk/docs/userguide/filetypes.html haiku/trunk/docs/userguide/gui.html haiku/trunk/docs/userguide/index.html haiku/trunk/docs/userguide/keyboard-shortcuts.html haiku/trunk/docs/userguide/preferences.html haiku/trunk/docs/userguide/preferences/prefs-images/sounds.png haiku/trunk/docs/userguide/queries.html haiku/trunk/docs/userguide/teammonitor.html haiku/trunk/docs/userguide/tracker-add-ons.html haiku/trunk/docs/userguide/tracker.html haiku/trunk/docs/userguide/twitcher.html haiku/trunk/docs/userguide/workshop-filetypes+attributes.html haiku/trunk/docs/userguide/workspaces.html haiku/trunk/docs/welcome/bugreports.html haiku/trunk/docs/welcome/welcome.css haiku/trunk/docs/welcome/welcome.html Log: Patch by Humdinger with the following commit message: * Added explanation of icons to Bootloader. * Applied css-fix by Braden Ewing to fix rendering under MS Internet Explorer. Added Braden to welcome.css authors. * Added a css class pre.terminal to make Terminal output more visible plus a few more things. Added myself to welcome.css authors. :) * Updated all Terminal output with the new pre-class tag. * Flaunted our beautiful icons at the top of every preference/application/applet plus their contents page. * Added icon PNGs in 16x16 32x32 and 64x64. * Added quick info where to find a preference/application/applet and its settings at the top of every page. * Added apps: ActivityMonitor, Magnify, StyledEdit, Terminal * Added applet: Launchbox * Added stubs to all missing prefs/apps/applets. Everyone's welcome to work on the contents (announce it on the mailing list, though!). * Moved preference/application/applet into own folders. * Updated contents page. * Reformatted everything to be XHTML1.0-Strict conforming. Added XHTML DTDs to welcome/html-dtd/. * Added copyright and author as comment to the header of every page. If someone else should be mentioned there, speak up. --- Whoot! What a titanian piece of work, Humdinger! Added: haiku/trunk/docs/userguide/applications/apps-activitymonitor.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-activitymonitor.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-activitymonitor.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,64 @@ + + + + + + + + + ActivityMonitor + + + + + +
+

+ Applications +     + Next: BePDF +

+
+ +
+ +

activitymonitor-icon_64.pngActivityMonitor

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/ActivityMonitor
Settings:~/config/settings/ActivityMonitor settings
+

You can track system resources by launching the ActivityMonitor and activating different items of interest. +

+activitymonitor.png +

By right-clicking into the window, you can toggle the display of all kinds of resources:
+Used/Cached Memory, Swap Space, CPU Usage, Network Receive/Send, Page faults, Semaphores, Ports, Threads, Teams, Running Applications, Raw/Text Clipboard Size, Media Nodes

+

Below the graphics is a legend (hideable from the context menu). You can change their colors and that of the graph's background via drag&drop from any color picker, e.g. from Icon-O-Matic.

+

You can add more views from the File menu if it gets too crowded.

+

Each view has it's own Replicator handle and can thus be arranged, for example, on the Desktop.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-bepdf.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-bepdf.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-bepdf.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,62 @@ + + + + + + + + + BePDF + + + + + +
+

+ Applications +     + Previous: ActivityMonitor +     + Next: CDPlayer +

+
+ +
+ +

bepdf-icon_64.pngBePDF

+ + + + + +
Deskbar:Applications
Location:/boot/apps/BePDF/BePDF
Documentation:/boot/apps/BePDF/docs/*
Settings:~/config/settings/???
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-cdplayer.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-cdplayer.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-cdplayer.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + CDPlayer + + + + + +
+

+ Applications +     + Previous: BePDF +     + Next: CodyCam +

+
+ +
+ +

cdplayer-icon_64.pngCDPlayer

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/CDPlayer
Settings:~/config/settings/???
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-codycam.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-codycam.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-codycam.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + CodyCam + + + + + +
+

+ Applications +     + Previous: CDPlayer +     + Next: DeskCalc +

+
+ +
+ +

codycam-icon_64.pngCodyCam

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/CodyCam
Settings:~/config/settings/???
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-deskcalc.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-deskcalc.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-deskcalc.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + DeskCalc + + + + + +
+

+ Applications +     + Previous: CodyCam +     + Next: DiskProbe +

+
+ +
+ +

deskcalc-icon_64.pngDeskCalc

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/DeskCalc
Settings:~/config/settings/DeskCalc_settings
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-diskprobe.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-diskprobe.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-diskprobe.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + DiskProbe + + + + + +
+

+ Applications +     + Previous: DeskCalc +     + Next: DriveUsage +

+
+ +
+ +

diskprobe-icon_64.pngDiskProbe

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/DiskProbe
Settings:~/config/settings/DiskProbe_data
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-diskusage.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-diskusage.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-diskusage.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,62 @@ + + + + + + + + + DiskUsage + + + + + +
+

+ Applications +     + Previous: DiskProbe +     + Next: DriveSetup +

+
+ +
+ +

diskusage-icon_64.pngDiskUsage

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/DiskUsage
Settings:~/config/settings/DiskUsage
+ +

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-drivesetup.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-drivesetup.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-drivesetup.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + DriveSetup + + + + + +
+

+ Applications +     + Previous: DiskUsage +     + Next: Expander +

+
+ +
+ +

drivesetup-icon_64.pngDriveSetup

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/DriveSetup
Settings:~/config/settings/DriveSetup
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-expander.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-expander.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-expander.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + Expander + + + + + +
+

+ Applications +     + Previous: DriveSetup +     + Next: Firefox +

+
+ +
+ +

expander-icon_64.pngExpander

+ + + + +
Deskbar:---
Location:/boot/beos/apps/Expander
Settings:~/config/settings/Expander_Settings
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-firefox.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-firefox.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-firefox.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + Firefox + + + + + +
+

+ Applications +     + Previous: Expander +     + Next: Icon-O-Matic +

+
+ +
+ +

firefox-icon_64.pngFirefox

+ + + + +
Deskbar:Applications
Location:/boot/apps/Firefox/Firefox
Settings:~/config/settings/Mozilla/Firefox/*
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-icon-o-matic.html =================================================================== --- haiku/trunk/docs/userguide/applications/apps-icon-o-matic.html 2008-12-09 23:16:10 UTC (rev 28790) +++ haiku/trunk/docs/userguide/applications/apps-icon-o-matic.html 2008-12-09 23:31:04 UTC (rev 28791) @@ -0,0 +1,61 @@ + + + + + + + + + Icon-O-Matic + + + + + +
+

+ Applications +     + Previous: Firefox +     + Next: Installer +

+
+ +
+ +

icon-o-matic-icon_64.pngIcon-O-Matic

+ + + + +
Deskbar:Applications
Location:/boot/beos/apps/Icon-O-Matic
Settings:~/config/settings/Icon-O-Matic
+

Documentation is still missing. If you want to work on it, announce it on the General mailing list to avoid duplication.

+ +
+ + + Added: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/activitymonitor.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/bepdf-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/cdplayer-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/codycam-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/deskcalc-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/diskprobe-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/diskusage-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_32.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_64.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/drivesetup-icon_64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: haiku/trunk/docs/userguide/applications/apps-images/expander-icon_16.png =================================================================== (Binary files differ) Property changes on: haiku/trunk/docs/userguide/applications/apps-images/expander-icon_16.png ___________________________________________________________________ Name: svn:mime-type [... truncated: 11666 lines follow ...] From anevilyak at mail.berlios.de Wed Dec 10 01:33:56 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 01:33:56 +0100 Subject: [Haiku-commits] r28792 - haiku/trunk/src/kits/screensaver Message-ID: <200812100033.mBA0XuN2013681@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 01:33:55 +0100 (Wed, 10 Dec 2008) New Revision: 28792 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28792&view=rev Modified: haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp Log: Correct slight regression from r28777 - screen saver tick size can be adjusted dynamically, and thus we must update it after each complete tick. Fixes ticket #3211. Modified: haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp =================================================================== --- haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-09 23:31:04 UTC (rev 28791) +++ haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-10 00:33:55 UTC (rev 28792) @@ -19,7 +19,6 @@ #include - ScreenSaverRunner::ScreenSaverRunner(BWindow* window, BView* view, bool preview, ScreenSaverSettings& settings) : @@ -181,10 +180,10 @@ fHasStarted = fSaver->StartSaver(fView, fPreview) == B_OK; fWindow->Unlock(); } - + int32 snoozeCount = 0; int32 frame = 0; - int32 tickCounter = 0; + bigtime_t lastTickTime = system_time(); bigtime_t tick = fSaver ? fSaver->TickSize() : kTickBase; while (!fQuitting) { @@ -194,11 +193,16 @@ // will result in the screen saver not responding to deactivation // for that length of time snooze(kTickBase); - if (++tickCounter * kTickBase < tick) + if (system_time() - lastTickTime < tick) continue; - else - tickCounter = 0; - + else { + // re-evaluate the tick time after each successful wakeup - + // screensavers can adjust it on the fly and we must be + // prepared to accomodate that + tick = fSaver ? fSaver->TickSize() : kTickBase; + lastTickTime = system_time(); + } + if (snoozeCount) { // if we are sleeping, do nothing snoozeCount--; From anevilyak at mail.berlios.de Wed Dec 10 01:44:15 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 01:44:15 +0100 Subject: [Haiku-commits] r28793 - in haiku/trunk: build/jam src/add-ons/screen_savers/message src/kits/screensaver Message-ID: <200812100044.mBA0iF3q026715@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 01:44:14 +0100 (Wed, 10 Dec 2008) New Revision: 28793 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28793&view=rev Modified: haiku/trunk/build/jam/HaikuImage haiku/trunk/src/add-ons/screen_savers/message/Message.cpp haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp Log: Adjust ScreenSaverRunner to make the screen saver draw once before sleeping. This fixes the perceived black screen problem with the Message screensaver. Also cleaned up Message slightly to retrieve its string from fortune more cleanly, and readded it to the build since it will no longer deadlock the screensaver module for 30 seconds at a time. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2008-12-10 00:33:55 UTC (rev 28792) +++ haiku/trunk/build/jam/HaikuImage 2008-12-10 00:44:14 UTC (rev 28793) @@ -130,7 +130,7 @@ BEOS_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR Parallel\ Port Print\ To\ File Serial\ Port USB\ Port ; -BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider ; +BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider Welcome ; BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki ; #hda BEOS_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia sis7018 usb_audio ; BEOS_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia Modified: haiku/trunk/src/add-ons/screen_savers/message/Message.cpp =================================================================== --- haiku/trunk/src/add-ons/screen_savers/message/Message.cpp 2008-12-10 00:33:55 UTC (rev 28792) +++ haiku/trunk/src/add-ons/screen_savers/message/Message.cpp 2008-12-10 00:44:14 UTC (rev 28793) @@ -21,17 +21,14 @@ #include #include - // Double brackets to satisfy a compiler warning const pattern kCheckered = { { 0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33 } }; - // Get a clever message from fortune BString *get_message() { BString *result = new BString(); - system("fortune > /tmp/fortune_msg"); - FILE *file = fopen("/tmp/fortune_msg", "r"); + FILE *file = popen("/bin/fortune", "r"); if (file) { char buf[512]; int bytesRead; @@ -41,7 +38,6 @@ } fclose(file); } - remove("/tmp/fortune_msg"); // Just in case if (result->Length() <= 0) { Modified: haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp =================================================================== --- haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-10 00:33:55 UTC (rev 28792) +++ haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-10 00:44:14 UTC (rev 28793) @@ -183,7 +183,7 @@ int32 snoozeCount = 0; int32 frame = 0; - bigtime_t lastTickTime = system_time(); + bigtime_t lastTickTime = -1; bigtime_t tick = fSaver ? fSaver->TickSize() : kTickBase; while (!fQuitting) { @@ -193,7 +193,7 @@ // will result in the screen saver not responding to deactivation // for that length of time snooze(kTickBase); - if (system_time() - lastTickTime < tick) + if (lastTickTime > 0 && system_time() - lastTickTime < tick) continue; else { // re-evaluate the tick time after each successful wakeup - From anevilyak at mail.berlios.de Wed Dec 10 01:54:32 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 01:54:32 +0100 Subject: [Haiku-commits] r28794 - haiku/trunk/build/jam Message-ID: <200812100054.mBA0sW6Q027837@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 01:54:32 +0100 (Wed, 10 Dec 2008) New Revision: 28794 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28794&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: And that should of course be Message, not Welcome...no idea how that happened.. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2008-12-10 00:44:14 UTC (rev 28793) +++ haiku/trunk/build/jam/HaikuImage 2008-12-10 00:54:32 UTC (rev 28794) @@ -130,7 +130,7 @@ BEOS_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR Parallel\ Port Print\ To\ File Serial\ Port USB\ Port ; -BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider Welcome ; +BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider Message ; BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki ; #hda BEOS_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia sis7018 usb_audio ; BEOS_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia From anevilyak at mail.berlios.de Wed Dec 10 02:06:50 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 02:06:50 +0100 Subject: [Haiku-commits] r28795 - haiku/trunk/headers/private/net Message-ID: <200812100106.mBA16occ028796@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 02:06:50 +0100 (Wed, 10 Dec 2008) New Revision: 28795 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28795&view=rev Modified: haiku/trunk/headers/private/net/net_notifications.h Log: send_notification needs to return a status_t, otherwise the build breaks in the notifications module. Modified: haiku/trunk/headers/private/net/net_notifications.h =================================================================== --- haiku/trunk/headers/private/net/net_notifications.h 2008-12-10 00:54:32 UTC (rev 28794) +++ haiku/trunk/headers/private/net/net_notifications.h 2008-12-10 01:06:50 UTC (rev 28795) @@ -18,7 +18,7 @@ struct net_notifications_module_info { module_info info; - void (*send_notification)(const BPrivate::KMessage* event); + status_t (*send_notification)(const BPrivate::KMessage* event); }; // generic syscall interface From anevilyak at mail.berlios.de Wed Dec 10 03:28:01 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 03:28:01 +0100 Subject: [Haiku-commits] r28796 - haiku/trunk/src/kits/screensaver Message-ID: <200812100228.mBA2S1EP011617@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 03:28:00 +0100 (Wed, 10 Dec 2008) New Revision: 28796 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28796&view=rev Modified: haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp Log: Remove unnecessary comparison. Modified: haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp =================================================================== --- haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-10 01:06:50 UTC (rev 28795) +++ haiku/trunk/src/kits/screensaver/ScreenSaverRunner.cpp 2008-12-10 02:28:00 UTC (rev 28796) @@ -183,7 +183,7 @@ int32 snoozeCount = 0; int32 frame = 0; - bigtime_t lastTickTime = -1; + bigtime_t lastTickTime = 0; bigtime_t tick = fSaver ? fSaver->TickSize() : kTickBase; while (!fQuitting) { @@ -193,7 +193,7 @@ // will result in the screen saver not responding to deactivation // for that length of time snooze(kTickBase); - if (lastTickTime > 0 && system_time() - lastTickTime < tick) + if (system_time() - lastTickTime < tick) continue; else { // re-evaluate the tick time after each successful wakeup - From korli at users.berlios.de Wed Dec 10 11:51:58 2008 From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=) Date: Wed, 10 Dec 2008 11:51:58 +0100 Subject: [Haiku-commits] r28782 In-Reply-To: References: Message-ID: Sorry indeed, build broken. I can only fix by the end of the day. Feel free to fix. Bye J?r?me 2008/12/8 Rene Gollent : > Hi Jerome, > > I think you might have forgotten some files in this checkin, the code > calls KeyMap::KeyForModifier() which doesn't seem to be present in the > version in the repository, and also fCommandKey / fControlKey are > undefined in the KeyboardDevice class. > > Regards, > > Rene > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > From axeld at pinc-software.de Wed Dec 10 12:41:30 2008 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 10 Dec 2008 12:41:30 +0100 CET Subject: [Haiku-commits] r28795 - haiku/trunk/headers/private/net In-Reply-To: <200812100106.mBA16occ028796@sheep.berlios.de> Message-ID: <10712415790-BeMail@zon> anevilyak at BerliOS wrote: > Log: > send_notification needs to return a status_t, otherwise the build > breaks in the notifications module. Another last minute change; it will stay "void", though, in the future. Thanks! I thought I had compiled after that change... Bye, Axel. From axeld at pinc-software.de Wed Dec 10 12:53:01 2008 From: axeld at pinc-software.de (Axel =?utf-8?q?D=C3=B6rfler?=) Date: Wed, 10 Dec 2008 12:53:01 +0100 CET Subject: [Haiku-commits] =?utf-8?q?r28785_-_in_haiku/trunk/src=3A_preferen?= =?utf-8?q?ces/screen_servers/app?= In-Reply-To: <200812090250.mB92oQJ5005066@sheep.berlios.de> Message-ID: <11403302814-BeMail@zon> anevilyak at BerliOS wrote: > +++ haiku/trunk/src/servers/app/Screen.cpp 2008-12-09 02:50:23 UTC > (rev 28785) > @@ -22,7 +22,6 @@ > #include > #include > > - > static float > get_mode_frequency(const display_mode& mode) Two spaces between functions (and includes). > { > @@ -91,6 +90,12 @@ > status_t > Screen::SetMode(const display_mode& mode, bool makeDefault) > { > + display_mode current; > + GetMode(¤t); > + current.flags = mode.flags; > + if (!memcmp(&mode, ¤t, sizeof(display_mode))) > + return B_OK; You should add a TODO comment on why you reset the flags here. Anyway, nice change! Bye, Axel. From anevilyak at gmail.com Wed Dec 10 14:53:32 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Wed, 10 Dec 2008 07:53:32 -0600 Subject: [Haiku-commits] r28785 - in haiku/trunk/src: preferences/screen servers/app In-Reply-To: <11403302814-BeMail@zon> References: <200812090250.mB92oQJ5005066@sheep.berlios.de> <11403302814-BeMail@zon> Message-ID: Hi Axel, On Wed, Dec 10, 2008 at 5:53 AM, Axel D?rfler wrote: > > You should add a TODO comment on why you reset the flags here. Good idea, though in general I'm somewhat wondering how best to handle that, since some of the flags seem to indicate hardware capabilities like HW cursor and so forth, and those don't generally seem to be something user settable. Is it possible to probe the accelerant for capabilities as concerns that flags field? Regards, Rene From anevilyak at gmail.com Wed Dec 10 15:32:09 2008 From: anevilyak at gmail.com (Rene Gollent) Date: Wed, 10 Dec 2008 08:32:09 -0600 Subject: [Haiku-commits] r28795 - haiku/trunk/headers/private/net In-Reply-To: <10712415790-BeMail@zon> References: <200812100106.mBA16occ028796@sheep.berlios.de> <10712415790-BeMail@zon> Message-ID: On Wed, Dec 10, 2008 at 5:41 AM, Axel D?rfler wrote: > Another last minute change; it will stay "void", though, in the future. > Thanks! I thought I had compiled after that change... Ah, sorry :) I assumed it was supposed to be status_t since that was what you were using it as a return for in every place in notifications.cpp :) Regards, Rene From anevilyak at mail.berlios.de Wed Dec 10 15:34:36 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 15:34:36 +0100 Subject: [Haiku-commits] r28797 - haiku/trunk/src/add-ons/input_server/devices/keyboard Message-ID: <200812101434.mBAEYatX018296@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 15:34:36 +0100 (Wed, 10 Dec 2008) New Revision: 28797 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28797&view=rev Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.h haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.h Log: Build fix, thanks to Olivier Cortes for submitting! Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.h =================================================================== --- haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.h 2008-12-10 02:28:00 UTC (rev 28796) +++ haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.h 2008-12-10 14:34:36 UTC (rev 28797) @@ -58,6 +58,8 @@ bool fIsAT; volatile bool fInputMethodStarted; uint32 fModifiers; + uint32 fCommandKey; + uint32 fControlKey; volatile bool fUpdateSettings; volatile uint32 fSettingsCommand; Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp =================================================================== --- haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp 2008-12-10 02:28:00 UTC (rev 28796) +++ haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp 2008-12-10 14:34:36 UTC (rev 28797) @@ -155,7 +155,21 @@ return 0; } +uint32 +Keymap::KeyForModifier(uint32 modifier) +{ + if (modifier == B_LEFT_COMMAND_KEY) + return fKeys.left_command_key; + if (modifier == B_RIGHT_COMMAND_KEY) + return fKeys.right_command_key; + if (modifier == B_LEFT_CONTROL_KEY) + return fKeys.left_control_key; + if (modifier == B_RIGHT_CONTROL_KEY) + return fKeys.right_control_key; + return 0; +} + //! Tell if a key is a dead key, needed for draw a dead key uint8 Keymap::IsDeadKey(uint32 keyCode, uint32 modifiers) Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.h =================================================================== --- haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.h 2008-12-10 02:28:00 UTC (rev 28796) +++ haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.h 2008-12-10 14:34:36 UTC (rev 28797) @@ -27,6 +27,7 @@ void DumpKeymap(); bool IsModifierKey(uint32 keyCode); uint32 Modifier(uint32 keyCode); + uint32 KeyForModifier(uint32 modifier); uint8 IsDeadKey(uint32 keyCode, uint32 modifiers); bool IsDeadSecondKey(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey); void GetChars(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey, char** chars, int32* numBytes); From anevilyak at mail.berlios.de Wed Dec 10 15:36:53 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 15:36:53 +0100 Subject: [Haiku-commits] r28798 - haiku/trunk/src/add-ons/input_server/devices/keyboard Message-ID: <200812101436.mBAEarbS018475@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 15:36:53 +0100 (Wed, 10 Dec 2008) New Revision: 28798 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28798&view=rev Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp Log: Correct small style violation. Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp =================================================================== --- haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp 2008-12-10 14:34:36 UTC (rev 28797) +++ haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp 2008-12-10 14:36:53 UTC (rev 28798) @@ -155,6 +155,7 @@ return 0; } + uint32 Keymap::KeyForModifier(uint32 modifier) { @@ -170,6 +171,7 @@ return 0; } + //! Tell if a key is a dead key, needed for draw a dead key uint8 Keymap::IsDeadKey(uint32 keyCode, uint32 modifiers) From anevilyak at mail.berlios.de Wed Dec 10 15:41:10 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Wed, 10 Dec 2008 15:41:10 +0100 Subject: [Haiku-commits] r28799 - haiku/trunk/src/servers/app Message-ID: <200812101441.mBAEfARQ018865@sheep.berlios.de> Author: anevilyak Date: 2008-12-10 15:41:10 +0100 (Wed, 10 Dec 2008) New Revision: 28799 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28799&view=rev Modified: haiku/trunk/src/servers/app/Screen.cpp Log: Correct a small style violation noted by Axel, and add a TODO note. Modified: haiku/trunk/src/servers/app/Screen.cpp =================================================================== --- haiku/trunk/src/servers/app/Screen.cpp 2008-12-10 14:36:53 UTC (rev 28798) +++ haiku/trunk/src/servers/app/Screen.cpp 2008-12-10 14:41:10 UTC (rev 28799) @@ -22,6 +22,7 @@ #include #include + static float get_mode_frequency(const display_mode& mode) { @@ -92,6 +93,18 @@ { display_mode current; GetMode(¤t); + // TODO: decide how best to handle the flags here - things like + // the screen preflet will generally always set the flags to 0, + // while it seems asking the accelerant to automatically pick the + // best mode might not necessarily. For the time being, match the + // flags before doing the mode comparison in order to prevent + // mode switches for otherwise identical modes (this was relatively + // easily observed on at least the radeon accelerant - on first boot + // the best mode picked included a flag mask of 0xffffffff ; + // if you switched the resolution of one workspace to something else + // and then back to the resolution it started with, you would observe + // a mode switch when jumping between that workspace and the others + // that were still using the automatically set default mode) current.flags = mode.flags; if (!memcmp(&mode, ¤t, sizeof(display_mode))) return B_OK; From leavengood at gmail.com Wed Dec 10 20:11:05 2008 From: leavengood at gmail.com (Ryan Leavengood) Date: Wed, 10 Dec 2008 14:11:05 -0500 Subject: [Haiku-commits] r28793 - in haiku/trunk: build/jam src/add-ons/screen_savers/message src/kits/screensaver In-Reply-To: <200812100044.mBA0iF3q026715@sheep.berlios.de> References: <200812100044.mBA0iF3q026715@sheep.berlios.de> Message-ID: On Tue, Dec 9, 2008 at 7:44 PM, anevilyak at BerliOS wrote: > Author: anevilyak > Date: 2008-12-10 01:44:14 +0100 (Wed, 10 Dec 2008) > New Revision: 28793 > > -BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider ; > +BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider Welcome ; Welcome? Shouldn't that be Message? Either way thanks for the fixes. Ryan From anevilyak at mail.berlios.de Thu Dec 11 05:27:56 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Thu, 11 Dec 2008 05:27:56 +0100 Subject: [Haiku-commits] r28800 - haiku/trunk/src/add-ons/input_server/devices/keyboard Message-ID: <200812110427.mBB4RuFA016647@sheep.berlios.de> Author: anevilyak Date: 2008-12-11 05:27:56 +0100 (Thu, 11 Dec 2008) New Revision: 28800 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28800&view=rev Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp Log: Updated patch from Olivier Cortes - complete the list of modifier keys that are checked and returned. Thanks! Modified: haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp =================================================================== --- haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp 2008-12-10 14:41:10 UTC (rev 28799) +++ haiku/trunk/src/add-ons/input_server/devices/keyboard/Keymap.cpp 2008-12-11 04:27:56 UTC (rev 28800) @@ -159,14 +159,30 @@ uint32 Keymap::KeyForModifier(uint32 modifier) { - if (modifier == B_LEFT_COMMAND_KEY) + if (modifier == B_CAPS_LOCK) + return fKeys.caps_key; + if (modifier == B_NUM_LOCK) + return fKeys.num_key; + if (modifier == B_SCROLL_LOCK) + return fKeys.scroll_key; + if (modifier == B_LEFT_SHIFT_KEY || modifier == B_SHIFT_KEY) + return fKeys.left_shift_key; + if (modifier == B_RIGHT_SHIFT_KEY) + return fKeys.right_shift_key; + if (modifier == B_LEFT_COMMAND_KEY || modifier == B_COMMAND_KEY) return fKeys.left_command_key; if (modifier == B_RIGHT_COMMAND_KEY) return fKeys.right_command_key; - if (modifier == B_LEFT_CONTROL_KEY) + if (modifier == B_LEFT_CONTROL_KEY || modifier == B_CONTROL_KEY) return fKeys.left_control_key; if (modifier == B_RIGHT_CONTROL_KEY) return fKeys.right_control_key; + if (modifier == B_LEFT_OPTION_KEY || modifier == B_OPTION_KEY) + return fKeys.left_option_key; + if (modifier == B_RIGHT_OPTION_KEY) + return fKeys.right_option_key; + if (modifier == B_MENU_KEY) + return fKeys.menu_key; return 0; } From korli at mail.berlios.de Thu Dec 11 23:54:04 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Thu, 11 Dec 2008 23:54:04 +0100 Subject: [Haiku-commits] r28801 - haiku/trunk/src/kits/opengl/glut Message-ID: <200812112254.mBBMs45j007835@sheep.berlios.de> Author: korli Date: 2008-12-11 23:54:04 +0100 (Thu, 11 Dec 2008) New Revision: 28801 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28801&view=rev Modified: haiku/trunk/src/kits/opengl/glut/glutWindow.cpp Log: unlock the application after calling Quit(): this fixes #3188. Not sure it's the best fix. Modified: haiku/trunk/src/kits/opengl/glut/glutWindow.cpp =================================================================== --- haiku/trunk/src/kits/opengl/glut/glutWindow.cpp 2008-12-11 04:27:56 UTC (rev 28800) +++ haiku/trunk/src/kits/opengl/glut/glutWindow.cpp 2008-12-11 22:54:04 UTC (rev 28801) @@ -330,6 +330,7 @@ } gState.display->Lock(); gState.display->Quit(); + gState.display->Unlock(); status_t ignored; wait_for_thread(gState.appthread, &ignored); From korli at mail.berlios.de Fri Dec 12 23:17:06 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Fri, 12 Dec 2008 23:17:06 +0100 Subject: [Haiku-commits] r28802 - haiku/trunk/build/jam Message-ID: <200812122217.mBCMH6cV027717@sheep.berlios.de> Author: korli Date: 2008-12-12 23:17:05 +0100 (Fri, 12 Dec 2008) New Revision: 28802 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28802&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: added p7zip as an optional package Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2008-12-11 22:54:04 UTC (rev 28801) +++ haiku/trunk/build/jam/OptionalPackages 2008-12-12 22:17:05 UTC (rev 28802) @@ -27,6 +27,7 @@ # OpenSound # OpenSSH # OpenSSL +# P7zip # Pe # Perl # Subversion @@ -379,6 +380,34 @@ } + +# P7zip +if [ IsOptionalHaikuImagePackageAdded P7zip ] { + if $(TARGET_ARCH) != x86 { + Echo "No optional package P7zip available for $(TARGET_ARCH)" ; + } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { + Echo "No optional package P7zip available for gcc4" ; + } else { + InstallOptionalHaikuImagePackage p7zip-4.61-gcc2-2008-12-03 + : http://ports.haiku-files.org/downloads/82 + : + ; + + actions BuildHaikuImageExpanderRules + { + echo "\"application/x-7z-compressed\"\t.7z\t\"7za l \0045s\"\t\"7za x -y \0045s\"" > $(1) + } + + Always expander.rules ; + MakeLocate expander.rules : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ; + BuildHaikuImageExpanderRules expander.rules ; + AddFilesToHaikuImage home config etc : expander.rules ; + } +} + + + + # Pe text editor if [ IsOptionalHaikuImagePackageAdded Pe ] { if $(TARGET_ARCH) != x86 { From mmu_man at mail.berlios.de Sat Dec 13 03:30:08 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 13 Dec 2008 03:30:08 +0100 Subject: [Haiku-commits] r28803 - haiku/trunk/src/add-ons/kernel/bus_managers/pci Message-ID: <200812130230.mBD2U8dO020906@sheep.berlios.de> Author: mmu_man Date: 2008-12-13 03:30:07 +0100 (Sat, 13 Dec 2008) New Revision: 28803 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28803&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/pci/pci_device.cpp Log: return a proper error after the panic when no device is found, and avoid a leak. Shouldn't happen anyway, but doesn't hurt. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/pci/pci_device.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/pci/pci_device.cpp 2008-12-12 22:17:05 UTC (rev 28802) +++ haiku/trunk/src/add-ons/kernel/bus_managers/pci/pci_device.cpp 2008-12-13 02:30:07 UTC (rev 28803) @@ -119,14 +119,17 @@ &function, false) != B_OK) return B_ERROR; + PCIDev *dev = gPCI->FindDevice(domain, bus, deviceNumber, function); + if (dev == NULL) { + panic("device not found!\n"); + return ENODEV; + } + pci_device* device = (pci_device*)malloc(sizeof(*device)); if (device == NULL) return B_NO_MEMORY; - device->device = gPCI->FindDevice(domain, bus, deviceNumber, function); - if (device->device == NULL) - panic("device not found!\n"); - + device->device = dev; device->node = node; *_cookie = device; From colacoder at mail.berlios.de Sat Dec 13 13:29:46 2008 From: colacoder at mail.berlios.de (colacoder at BerliOS) Date: Sat, 13 Dec 2008 13:29:46 +0100 Subject: [Haiku-commits] r28804 - in haiku/vendor/freebsd/current/dev: . ae ale Message-ID: <200812131229.mBDCTkaa021451@sheep.berlios.de> Author: colacoder Date: 2008-12-13 13:29:46 +0100 (Sat, 13 Dec 2008) New Revision: 28804 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28804&view=rev Added: haiku/vendor/freebsd/current/dev/ae/ haiku/vendor/freebsd/current/dev/ae/if_ae.c haiku/vendor/freebsd/current/dev/ae/if_aereg.h haiku/vendor/freebsd/current/dev/ae/if_aevar.h haiku/vendor/freebsd/current/dev/ale/ haiku/vendor/freebsd/current/dev/ale/if_ale.c haiku/vendor/freebsd/current/dev/ale/if_alereg.h haiku/vendor/freebsd/current/dev/ale/if_alevar.h Log: Added ae and ale drivers to the FreeBSD vendor branch. Added: haiku/vendor/freebsd/current/dev/ae/if_ae.c =================================================================== --- haiku/vendor/freebsd/current/dev/ae/if_ae.c 2008-12-13 02:30:07 UTC (rev 28803) +++ haiku/vendor/freebsd/current/dev/ae/if_ae.c 2008-12-13 12:29:46 UTC (rev 28804) @@ -0,0 +1,2223 @@ +/*- + * Copyright (c) 2008 Stanislav Sedov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Driver for Attansic Technology Corp. L2 FastEthernet adapter. + * + * This driver is heavily based on age(4) Attansic L1 driver by Pyun YongHyeon. + */ + +#include +__FBSDID("$FreeBSD: src/sys/dev/ae/if_ae.c,v 1.1.2.1.2.1 2008/11/25 02:59:29 kensmith Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "miibus_if.h" + +#include "if_aereg.h" +#include "if_aevar.h" + +/* + * Devices supported by this driver. + */ +static struct ae_dev { + uint16_t vendorid; + uint16_t deviceid; + const char *name; +} ae_devs[] = { + { VENDORID_ATTANSIC, DEVICEID_ATTANSIC_L2, + "Attansic Technology Corp, L2 FastEthernet" }, +}; +#define AE_DEVS_COUNT (sizeof(ae_devs) / sizeof(*ae_devs)) + +static struct resource_spec ae_res_spec_mem[] = { + { SYS_RES_MEMORY, PCIR_BAR(0), RF_ACTIVE }, + { -1, 0, 0 } +}; +static struct resource_spec ae_res_spec_irq[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; +static struct resource_spec ae_res_spec_msi[] = { + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static int ae_probe(device_t dev); +static int ae_attach(device_t dev); +static void ae_pcie_init(ae_softc_t *sc); +static void ae_phy_reset(ae_softc_t *sc); +static void ae_phy_init(ae_softc_t *sc); +static int ae_reset(ae_softc_t *sc); +static void ae_init(void *arg); +static int ae_init_locked(ae_softc_t *sc); +static unsigned int ae_detach(device_t dev); +static int ae_miibus_readreg(device_t dev, int phy, int reg); +static int ae_miibus_writereg(device_t dev, int phy, int reg, int val); +static void ae_miibus_statchg(device_t dev); +static void ae_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr); +static int ae_mediachange(struct ifnet *ifp); +static void ae_retrieve_address(ae_softc_t *sc); +static void ae_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, + int error); +static int ae_alloc_rings(ae_softc_t *sc); +static void ae_dma_free(ae_softc_t *sc); +static int ae_shutdown(device_t dev); +static int ae_suspend(device_t dev); +static void ae_powersave_disable(ae_softc_t *sc); +static void ae_powersave_enable(ae_softc_t *sc); +static int ae_resume(device_t dev); +static unsigned int ae_tx_avail_size(ae_softc_t *sc); +static int ae_encap(ae_softc_t *sc, struct mbuf **m_head); +static void ae_start(struct ifnet *ifp); +static void ae_link_task(void *arg, int pending); +static void ae_stop_rxmac(ae_softc_t *sc); +static void ae_stop_txmac(ae_softc_t *sc); +static void ae_tx_task(void *arg, int pending); +static void ae_mac_config(ae_softc_t *sc); +static int ae_intr(void *arg); +static void ae_int_task(void *arg, int pending); +static void ae_tx_intr(ae_softc_t *sc); +static int ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd); +static void ae_rx_intr(ae_softc_t *sc); +static void ae_watchdog(ae_softc_t *sc); +static void ae_tick(void *arg); +static void ae_rxfilter(ae_softc_t *sc); +static void ae_rxvlan(ae_softc_t *sc); +static int ae_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); +static void ae_stop(ae_softc_t *sc); +static int ae_check_eeprom_present(ae_softc_t *sc, int *vpdc); +static int ae_vpd_read_word(ae_softc_t *sc, int reg, uint32_t *word); +static int ae_get_vpd_eaddr(ae_softc_t *sc, uint32_t *eaddr); +static int ae_get_reg_eaddr(ae_softc_t *sc, uint32_t *eaddr); +static void ae_update_stats_rx(uint16_t flags, ae_stats_t *stats); +static void ae_update_stats_tx(uint16_t flags, ae_stats_t *stats); +static void ae_init_tunables(ae_softc_t *sc); + +static device_method_t ae_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, ae_probe), + DEVMETHOD(device_attach, ae_attach), + DEVMETHOD(device_detach, ae_detach), + DEVMETHOD(device_shutdown, ae_shutdown), + DEVMETHOD(device_suspend, ae_suspend), + DEVMETHOD(device_resume, ae_resume), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, ae_miibus_readreg), + DEVMETHOD(miibus_writereg, ae_miibus_writereg), + DEVMETHOD(miibus_statchg, ae_miibus_statchg), + + { NULL, NULL } +}; +static driver_t ae_driver = { + "ae", + ae_methods, + sizeof(ae_softc_t) +}; +static devclass_t ae_devclass; + +DRIVER_MODULE(ae, pci, ae_driver, ae_devclass, 0, 0); +DRIVER_MODULE(miibus, ae, miibus_driver, miibus_devclass, 0, 0); +MODULE_DEPEND(ae, pci, 1, 1, 1); +MODULE_DEPEND(ae, ether, 1, 1, 1); +MODULE_DEPEND(ae, miibus, 1, 1, 1); + +/* + * Tunables. + */ +static int msi_disable = 0; +TUNABLE_INT("hw.ae.msi_disable", &msi_disable); + +#define AE_READ_4(sc, reg) \ + bus_read_4((sc)->mem[0], (reg)) +#define AE_READ_2(sc, reg) \ + bus_read_2((sc)->mem[0], (reg)) +#define AE_READ_1(sc, reg) \ + bus_read_1((sc)->mem[0], (reg)) +#define AE_WRITE_4(sc, reg, val) \ + bus_write_4((sc)->mem[0], (reg), (val)) +#define AE_WRITE_2(sc, reg, val) \ + bus_write_2((sc)->mem[0], (reg), (val)) +#define AE_WRITE_1(sc, reg, val) \ + bus_write_1((sc)->mem[0], (reg), (val)) +#define AE_PHY_READ(sc, reg) \ + ae_miibus_readreg(sc->dev, 0, reg) +#define AE_PHY_WRITE(sc, reg, val) \ + ae_miibus_writereg(sc->dev, 0, reg, val) +#define AE_CHECK_EADDR_VALID(eaddr) \ + ((eaddr[0] == 0 && eaddr[1] == 0) || \ + (eaddr[0] == 0xffffffff && eaddr[1] == 0xffff)) +#define AE_RXD_VLAN(vtag) \ + (((vtag) >> 4) | (((vtag) & 0x07) << 13) | (((vtag) & 0x08) << 9)) +#define AE_TXD_VLAN(vtag) \ + (((vtag) << 4) | (((vtag) >> 13) & 0x07) | (((vtag) >> 9) & 0x08)) + +/* + * ae statistics. + */ +#define STATS_ENTRY(node, desc, field) \ + { node, desc, offsetof(struct ae_stats, field) } +struct { + const char *node; + const char *desc; + intptr_t offset; +} ae_stats_tx[] = { + STATS_ENTRY("bcast", "broadcast frames", tx_bcast), + STATS_ENTRY("mcast", "multicast frames", tx_mcast), + STATS_ENTRY("pause", "PAUSE frames", tx_pause), + STATS_ENTRY("control", "control frames", tx_ctrl), + STATS_ENTRY("defers", "deferrals occuried", tx_defer), + STATS_ENTRY("exc_defers", "excessive deferrals occuried", tx_excdefer), + STATS_ENTRY("singlecols", "single collisions occuried", tx_singlecol), + STATS_ENTRY("multicols", "multiple collisions occuried", tx_multicol), + STATS_ENTRY("latecols", "late collisions occuried", tx_latecol), + STATS_ENTRY("aborts", "transmit aborts due collisions", tx_abortcol), + STATS_ENTRY("underruns", "Tx FIFO underruns", tx_underrun) +}, ae_stats_rx[] = { + STATS_ENTRY("bcast", "broadcast frames", rx_bcast), + STATS_ENTRY("mcast", "multicast frames", rx_mcast), + STATS_ENTRY("pause", "PAUSE frames", rx_pause), + STATS_ENTRY("control", "control frames", rx_ctrl), + STATS_ENTRY("crc_errors", "frames with CRC errors", rx_crcerr), + STATS_ENTRY("code_errors", "frames with invalid opcode", rx_codeerr), + STATS_ENTRY("runt", "runt frames", rx_runt), + STATS_ENTRY("frag", "fragmented frames", rx_frag), + STATS_ENTRY("align_errors", "frames with alignment errors", rx_align), + STATS_ENTRY("truncated", "frames truncated due to Rx FIFO inderrun", + rx_trunc) +}; +#define AE_STATS_RX_LEN (sizeof(ae_stats_rx) / sizeof(*ae_stats_rx)) +#define AE_STATS_TX_LEN (sizeof(ae_stats_tx) / sizeof(*ae_stats_tx)) + +static int +ae_probe(device_t dev) +{ + uint16_t deviceid, vendorid; + int i; + + vendorid = pci_get_vendor(dev); + deviceid = pci_get_device(dev); + + /* + * Search through the list of supported devs for matching one. + */ + for (i = 0; i < AE_DEVS_COUNT; i++) { + if (vendorid == ae_devs[i].vendorid && + deviceid == ae_devs[i].deviceid) { + device_set_desc(dev, ae_devs[i].name); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + +static int +ae_attach(device_t dev) +{ + ae_softc_t *sc; + struct ifnet *ifp; + uint8_t chiprev; + uint32_t pcirev; + int nmsi, pmc; + int error; + + sc = device_get_softc(dev); /* Automatically allocated and zeroed + on attach. */ + KASSERT(sc != NULL, ("[ae, %d]: sc is NULL", __LINE__)); + sc->dev = dev; + + /* + * Initialize mutexes and tasks. + */ + mtx_init(&sc->mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&sc->tick_ch, &sc->mtx, 0); + TASK_INIT(&sc->int_task, 0, ae_int_task, sc); + TASK_INIT(&sc->link_task, 0, ae_link_task, sc); + + pci_enable_busmaster(dev); /* Enable bus mastering. */ + + sc->spec_mem = ae_res_spec_mem; + + /* + * Allocate memory-mapped registers. + */ + error = bus_alloc_resources(dev, sc->spec_mem, sc->mem); + if (error != 0) { + device_printf(dev, "could not allocate memory resources.\n"); + sc->spec_mem = NULL; + goto fail; + } + + /* + * Retrieve PCI and chip revisions. + */ + pcirev = pci_get_revid(dev); + chiprev = (AE_READ_4(sc, AE_MASTER_REG) >> AE_MASTER_REVNUM_SHIFT) & + AE_MASTER_REVNUM_MASK; + if (bootverbose) { + device_printf(dev, "pci device revision: %#04x\n", pcirev); + device_printf(dev, "chip id: %#02x\n", chiprev); + } + nmsi = pci_msi_count(dev); + if (bootverbose) + device_printf(dev, "MSI count: %d.\n", nmsi); + + /* + * Allocate interrupt resources. + */ + if (msi_disable == 0 && nmsi == 1) { + error = pci_alloc_msi(dev, &nmsi); + if (error == 0) { + device_printf(dev, "Using MSI messages.\n"); + sc->spec_irq = ae_res_spec_msi; + error = bus_alloc_resources(dev, sc->spec_irq, sc->irq); + if (error != 0) { + device_printf(dev, "MSI allocation failed.\n"); + sc->spec_irq = NULL; + pci_release_msi(dev); + } else { + sc->flags |= AE_FLAG_MSI; + } + } + } + if (sc->spec_irq == NULL) { + sc->spec_irq = ae_res_spec_irq; + error = bus_alloc_resources(dev, sc->spec_irq, sc->irq); + if (error != 0) { + device_printf(dev, "could not allocate IRQ resources.\n"); + sc->spec_irq = NULL; + goto fail; + } + } + + ae_init_tunables(sc); + + ae_phy_reset(sc); /* Reset PHY. */ + error = ae_reset(sc); /* Reset the controller itself. */ + if (error != 0) + goto fail; + + ae_pcie_init(sc); + + ae_retrieve_address(sc); /* Load MAC address. */ + + error = ae_alloc_rings(sc); /* Allocate ring buffers. */ + if (error != 0) + goto fail; + + /* Set default PHY address. */ + sc->phyaddr = AE_PHYADDR_DEFAULT; + + ifp = sc->ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "could not allocate ifnet structure.\n"); + error = ENXIO; + } + + ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = ae_ioctl; + ifp->if_start = ae_start; + ifp->if_init = ae_init; + ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; + ifp->if_hwassist = 0; + ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) + sc->flags |= AE_FLAG_PMG; + ifp->if_capenable = ifp->if_capabilities; + + /* + * Configure and attach MII bus. + */ + error = mii_phy_probe(dev, &sc->miibus, ae_mediachange, + ae_mediastatus); + if (error != 0) { + device_printf(dev, "no PHY found.\n"); + goto fail; + } + + ether_ifattach(ifp, sc->eaddr); + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + + /* + * Create and run all helper tasks. + */ + TASK_INIT(&sc->tx_task, 1, ae_tx_task, ifp); + sc->tq = taskqueue_create_fast("ae_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->tq); + if (sc->tq == NULL) { + device_printf(dev, "could not create taskqueue.\n"); + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->dev)); + + /* + * Configure interrupt handlers. + */ + error = bus_setup_intr(dev, sc->irq[0], INTR_TYPE_NET | INTR_MPSAFE, + ae_intr, NULL, sc, &sc->intrhand); + if (error != 0) { + device_printf(dev, "could not set up interrupt handler.\n"); + taskqueue_free(sc->tq); + sc->tq = NULL; + ether_ifdetach(ifp); + goto fail; + } + +fail: + if (error != 0) + ae_detach(dev); + + return (error); +} + +static void +ae_init_tunables(ae_softc_t *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *root, *stats, *stats_rx, *stats_tx; + struct ae_stats *ae_stats; + unsigned int i; + + KASSERT(sc != NULL, ("[ae, %d]: sc is NULL", __LINE__)); + ae_stats = &sc->stats; + + ctx = device_get_sysctl_ctx(sc->dev); + root = device_get_sysctl_tree(sc->dev); + stats = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(root), OID_AUTO, "stats", + CTLFLAG_RD, NULL, "ae statistics"); + + /* + * Receiver statistcics. + */ + stats_rx = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, "rx", + CTLFLAG_RD, NULL, "Rx MAC statistics"); + for (i = 0; i < AE_STATS_RX_LEN; i++) + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(stats_rx), OID_AUTO, + ae_stats_rx[i].node, CTLFLAG_RD, (char *)ae_stats + + ae_stats_rx[i].offset, 0, ae_stats_rx[i].desc); + + /* + * Receiver statistcics. + */ + stats_tx = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, "tx", + CTLFLAG_RD, NULL, "Tx MAC statistics"); + for (i = 0; i < AE_STATS_TX_LEN; i++) + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(stats_tx), OID_AUTO, + ae_stats_tx[i].node, CTLFLAG_RD, (char *)ae_stats + + ae_stats_tx[i].offset, 0, ae_stats_tx[i].desc); +} + +static void +ae_pcie_init(ae_softc_t *sc) +{ + + AE_WRITE_4(sc, AE_PCIE_LTSSM_TESTMODE_REG, AE_PCIE_LTSSM_TESTMODE_DEFAULT); + AE_WRITE_4(sc, AE_PCIE_DLL_TX_CTRL_REG, AE_PCIE_DLL_TX_CTRL_DEFAULT); +} + +static void +ae_phy_reset(ae_softc_t *sc) +{ + + AE_WRITE_4(sc, AE_PHY_ENABLE_REG, AE_PHY_ENABLE); + DELAY(1000); /* XXX: pause(9) ? */ +} + +static int +ae_reset(ae_softc_t *sc) +{ + int i; + + /* + * Issue a soft reset. + */ + AE_WRITE_4(sc, AE_MASTER_REG, AE_MASTER_SOFT_RESET); + bus_barrier(sc->mem[0], AE_MASTER_REG, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + + /* + * Wait for reset to complete. + */ + for (i = 0; i < AE_RESET_TIMEOUT; i++) { + if ((AE_READ_4(sc, AE_MASTER_REG) & AE_MASTER_SOFT_RESET) == 0) + break; + DELAY(10); + } + if (i == AE_RESET_TIMEOUT) { + device_printf(sc->dev, "reset timeout.\n"); + return (ENXIO); + } + + /* + * Wait for everything to enter idle state. + */ + for (i = 0; i < AE_IDLE_TIMEOUT; i++) { + if (AE_READ_4(sc, AE_IDLE_REG) == 0) + break; + DELAY(100); + } + if (i == AE_IDLE_TIMEOUT) { + device_printf(sc->dev, "could not enter idle state.\n"); + return (ENXIO); + } + return (0); +} + +static void +ae_init(void *arg) +{ + ae_softc_t *sc; + + sc = (ae_softc_t *)arg; + AE_LOCK(sc); + ae_init_locked(sc); + AE_UNLOCK(sc); +} + +static void +ae_phy_init(ae_softc_t *sc) +{ + + /* + * Enable link status change interrupt. + * XXX magic numbers. + */ +#ifdef notyet + AE_PHY_WRITE(sc, 18, 0xc00); +#endif +} + +static int +ae_init_locked(ae_softc_t *sc) +{ + struct ifnet *ifp; + struct mii_data *mii; + uint8_t eaddr[ETHER_ADDR_LEN]; + uint32_t val; + bus_addr_t addr; + + AE_LOCK_ASSERT(sc); + + ifp = sc->ifp; + mii = device_get_softc(sc->miibus); + + ae_stop(sc); + ae_reset(sc); + ae_pcie_init(sc); /* Initialize PCIE stuff. */ + ae_phy_init(sc); + ae_powersave_disable(sc); + + /* + * Clear and disable interrupts. + */ + AE_WRITE_4(sc, AE_ISR_REG, 0xffffffff); + + /* + * Set the MAC address. + */ + bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); + val = eaddr[2] << 24 | eaddr[3] << 16 | eaddr[4] << 8 | eaddr[5]; + AE_WRITE_4(sc, AE_EADDR0_REG, val); + val = eaddr[0] << 8 | eaddr[1]; + AE_WRITE_4(sc, AE_EADDR1_REG, val); + + /* + * Set ring buffers base addresses. + */ + addr = sc->dma_rxd_busaddr; + AE_WRITE_4(sc, AE_DESC_ADDR_HI_REG, BUS_ADDR_HI(addr)); + AE_WRITE_4(sc, AE_RXD_ADDR_LO_REG, BUS_ADDR_LO(addr)); + addr = sc->dma_txd_busaddr; + AE_WRITE_4(sc, AE_TXD_ADDR_LO_REG, BUS_ADDR_LO(addr)); + addr = sc->dma_txs_busaddr; + AE_WRITE_4(sc, AE_TXS_ADDR_LO_REG, BUS_ADDR_LO(addr)); + + /* + * Configure ring buffers sizes. + */ + AE_WRITE_2(sc, AE_RXD_COUNT_REG, AE_RXD_COUNT_DEFAULT); + AE_WRITE_2(sc, AE_TXD_BUFSIZE_REG, AE_TXD_BUFSIZE_DEFAULT / 4); + AE_WRITE_2(sc, AE_TXS_COUNT_REG, AE_TXS_COUNT_DEFAULT); + + /* + * Configure interframe gap parameters. + */ + val = ((AE_IFG_TXIPG_DEFAULT << AE_IFG_TXIPG_SHIFT) & + AE_IFG_TXIPG_MASK) | + ((AE_IFG_RXIPG_DEFAULT << AE_IFG_RXIPG_SHIFT) & + AE_IFG_RXIPG_MASK) | + ((AE_IFG_IPGR1_DEFAULT << AE_IFG_IPGR1_SHIFT) & + AE_IFG_IPGR1_MASK) | + ((AE_IFG_IPGR2_DEFAULT << AE_IFG_IPGR2_SHIFT) & + AE_IFG_IPGR2_MASK); + AE_WRITE_4(sc, AE_IFG_REG, val); + + /* + * Configure half-duplex operation. + */ + val = ((AE_HDPX_LCOL_DEFAULT << AE_HDPX_LCOL_SHIFT) & + AE_HDPX_LCOL_MASK) | + ((AE_HDPX_RETRY_DEFAULT << AE_HDPX_RETRY_SHIFT) & + AE_HDPX_RETRY_MASK) | + ((AE_HDPX_ABEBT_DEFAULT << AE_HDPX_ABEBT_SHIFT) & + AE_HDPX_ABEBT_MASK) | + ((AE_HDPX_JAMIPG_DEFAULT << AE_HDPX_JAMIPG_SHIFT) & + AE_HDPX_JAMIPG_MASK) | AE_HDPX_EXC_EN; + AE_WRITE_4(sc, AE_HDPX_REG, val); + + /* + * Configure interrupt moderate timer. + */ + AE_WRITE_2(sc, AE_IMT_REG, AE_IMT_DEFAULT); + val = AE_READ_4(sc, AE_MASTER_REG); + val |= AE_MASTER_IMT_EN; + AE_WRITE_4(sc, AE_MASTER_REG, val); + + /* + * Configure interrupt clearing timer. + */ + AE_WRITE_2(sc, AE_ICT_REG, AE_ICT_DEFAULT); + + /* + * Configure MTU. + */ + val = ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + ETHER_CRC_LEN; + AE_WRITE_2(sc, AE_MTU_REG, val); + + /* + * Configure cut-through threshold. + */ + AE_WRITE_4(sc, AE_CUT_THRESH_REG, AE_CUT_THRESH_DEFAULT); + + /* + * Configure flow control. + */ + AE_WRITE_2(sc, AE_FLOW_THRESH_HI_REG, (AE_RXD_COUNT_DEFAULT / 8) * 7); + AE_WRITE_2(sc, AE_FLOW_THRESH_LO_REG, (AE_RXD_COUNT_MIN / 8) > + (AE_RXD_COUNT_DEFAULT / 12) ? (AE_RXD_COUNT_MIN / 8) : + (AE_RXD_COUNT_DEFAULT / 12)); + + /* + * Init mailboxes. + */ + sc->txd_cur = sc->rxd_cur = 0; + sc->txs_ack = sc->txd_ack = 0; + sc->rxd_cur = 0; + AE_WRITE_2(sc, AE_MB_TXD_IDX_REG, sc->txd_cur); + AE_WRITE_2(sc, AE_MB_RXD_IDX_REG, sc->rxd_cur); + + sc->tx_inproc = 0; /* Number of packets the chip processes now. */ + sc->flags |= AE_FLAG_TXAVAIL; /* Free Tx's available. */ + + /* + * Enable DMA. + */ + AE_WRITE_1(sc, AE_DMAREAD_REG, AE_DMAREAD_EN); + AE_WRITE_1(sc, AE_DMAWRITE_REG, AE_DMAWRITE_EN); + + /* + * Check if everything is OK. + */ + val = AE_READ_4(sc, AE_ISR_REG); + if ((val & AE_ISR_PHY_LINKDOWN) != 0) { + device_printf(sc->dev, "Initialization failed.\n"); + return (ENXIO); + } + + /* + * Clear interrupt status. + */ + AE_WRITE_4(sc, AE_ISR_REG, 0x3fffffff); + AE_WRITE_4(sc, AE_ISR_REG, 0x0); + + /* + * Enable interrupts. + */ + val = AE_READ_4(sc, AE_MASTER_REG); + AE_WRITE_4(sc, AE_MASTER_REG, val | AE_MASTER_MANUAL_INT); + AE_WRITE_4(sc, AE_IMR_REG, AE_IMR_DEFAULT); + + /* + * Disable WOL. + */ + AE_WRITE_4(sc, AE_WOL_REG, 0); + + /* + * Configure MAC. + */ + val = AE_MAC_TX_CRC_EN | AE_MAC_TX_AUTOPAD | + AE_MAC_FULL_DUPLEX | AE_MAC_CLK_PHY | + AE_MAC_TX_FLOW_EN | AE_MAC_RX_FLOW_EN | + ((AE_HALFBUF_DEFAULT << AE_HALFBUF_SHIFT) & AE_HALFBUF_MASK) | + ((AE_MAC_PREAMBLE_DEFAULT << AE_MAC_PREAMBLE_SHIFT) & + AE_MAC_PREAMBLE_MASK); + AE_WRITE_4(sc, AE_MAC_REG, val); + + /* + * Configure Rx MAC. + */ + ae_rxfilter(sc); + ae_rxvlan(sc); + + /* + * Enable Tx/Rx. + */ + val = AE_READ_4(sc, AE_MAC_REG); + AE_WRITE_4(sc, AE_MAC_REG, val | AE_MAC_TX_EN | AE_MAC_RX_EN); + + sc->flags &= ~AE_FLAG_LINK; + mii_mediachg(mii); /* Switch to the current media. */ + + callout_reset(&sc->tick_ch, hz, ae_tick, sc); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + +#ifdef AE_DEBUG + device_printf(sc->dev, "Initialization complete.\n"); +#endif + + return (0); +} + +static unsigned int +ae_detach(device_t dev) +{ + struct ae_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + KASSERT(sc != NULL, ("[ae: %d]: sc is NULL", __LINE__)); + ifp = sc->ifp; + if (device_is_attached(dev)) { + AE_LOCK(sc); + sc->flags |= AE_FLAG_DETACH; + ae_stop(sc); + AE_UNLOCK(sc); + callout_drain(&sc->tick_ch); + taskqueue_drain(sc->tq, &sc->int_task); + taskqueue_drain(sc->tq, &sc->tx_task); + taskqueue_drain(taskqueue_swi, &sc->link_task); + ether_ifdetach(ifp); + } + if (sc->tq != NULL) { + taskqueue_drain(sc->tq, &sc->int_task); + taskqueue_free(sc->tq); + sc->tq = NULL; + } + if (sc->miibus != NULL) { + device_delete_child(dev, sc->miibus); + sc->miibus = NULL; + } + bus_generic_detach(sc->dev); + ae_dma_free(sc); + if (sc->intrhand != NULL) { + bus_teardown_intr(dev, sc->irq[0], sc->intrhand); + sc->intrhand = NULL; + } + if (ifp != NULL) { + if_free(ifp); + sc->ifp = NULL; + } + if (sc->spec_irq != NULL) + bus_release_resources(dev, sc->spec_irq, sc->irq); + if (sc->spec_mem != NULL) + bus_release_resources(dev, sc->spec_mem, sc->mem); + if ((sc->flags & AE_FLAG_MSI) != 0) + pci_release_msi(dev); + mtx_destroy(&sc->mtx); + + return (0); +} + +static int +ae_miibus_readreg(device_t dev, int phy, int reg) +{ + ae_softc_t *sc; + uint32_t val; + int i; + + sc = device_get_softc(dev); + KASSERT(sc != NULL, ("[ae, %d]: sc is NULL", __LINE__)); + + /* + * Locking is done in upper layers. + */ + + if (phy != sc->phyaddr) + return (0); + + val = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | + AE_MDIO_START | AE_MDIO_READ | AE_MDIO_SUP_PREAMBLE | + ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK); + AE_WRITE_4(sc, AE_MDIO_REG, val); + + /* + * Wait for operation to complete. + */ + for (i = 0; i < AE_MDIO_TIMEOUT; i++) { + DELAY(2); + val = AE_READ_4(sc, AE_MDIO_REG); + if ((val & (AE_MDIO_START | AE_MDIO_BUSY)) == 0) + break; + } + if (i == AE_MDIO_TIMEOUT) { + device_printf(sc->dev, "phy read timeout: %d.\n", reg); + return (0); + } + return ((val << AE_MDIO_DATA_SHIFT) & AE_MDIO_DATA_MASK); +} + +static int +ae_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + ae_softc_t *sc; + uint32_t aereg; + int i; + + sc = device_get_softc(dev); + KASSERT(sc != NULL, ("[ae, %d]: sc is NULL", __LINE__)); + + /* + * Locking is done in upper layers. + */ + + if (phy != sc->phyaddr) + return (0); + + aereg = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | + AE_MDIO_START | AE_MDIO_SUP_PREAMBLE | + ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK) | + ((val << AE_MDIO_DATA_SHIFT) & AE_MDIO_DATA_MASK); + AE_WRITE_4(sc, AE_MDIO_REG, aereg); + + /* + * Wait for operation to complete. + */ + for (i = 0; i < AE_MDIO_TIMEOUT; i++) { + DELAY(2); + aereg = AE_READ_4(sc, AE_MDIO_REG); + if ((aereg & (AE_MDIO_START | AE_MDIO_BUSY)) == 0) + break; + } + if (i == AE_MDIO_TIMEOUT) { + device_printf(sc->dev, "phy write timeout: %d.\n", reg); + } + return (0); +} + +static void +ae_miibus_statchg(device_t dev) +{ + ae_softc_t *sc; + + sc = device_get_softc(dev); + taskqueue_enqueue(taskqueue_swi, &sc->link_task); +} + +static void +ae_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + ae_softc_t *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + KASSERT(sc != NULL, ("[ae, %d]: sc is NULL", __LINE__)); + + AE_LOCK(sc); + mii = device_get_softc(sc->miibus); + mii_pollstat(mii); + ifmr->ifm_status = mii->mii_media_status; + ifmr->ifm_active = mii->mii_media_active; + AE_UNLOCK(sc); +} + +static int +ae_mediachange(struct ifnet *ifp) +{ + ae_softc_t *sc; + struct mii_data *mii; + struct mii_softc *mii_sc; + int error; + + /* XXX: check IFF_UP ?? */ + sc = ifp->if_softc; + KASSERT(sc != NULL, ("[ae, %d]: sc is NULL", __LINE__)); + AE_LOCK(sc); + mii = device_get_softc(sc->miibus); + if (mii->mii_instance != 0) { + LIST_FOREACH(mii_sc, &mii->mii_phys, mii_list) + mii_phy_reset(mii_sc); + } + error = mii_mediachg(mii); + AE_UNLOCK(sc); + + return (error); +} + +static int +ae_check_eeprom_present(ae_softc_t *sc, int *vpdc) +{ + int error; + uint32_t val; + + KASSERT(vpdc != NULL, ("[ae, %d]: vpdc is NULL!\n", __LINE__)); + + /* + * Not sure why, but Linux does this. + */ + val = AE_READ_4(sc, AE_SPICTL_REG); + if ((val & AE_SPICTL_VPD_EN) != 0) { + val &= ~AE_SPICTL_VPD_EN; + AE_WRITE_4(sc, AE_SPICTL_REG, val); + } + error = pci_find_extcap(sc->dev, PCIY_VPD, vpdc); + return (error); +} + +static int +ae_vpd_read_word(ae_softc_t *sc, int reg, uint32_t *word) +{ + uint32_t val; + int i; + + AE_WRITE_4(sc, AE_VPD_DATA_REG, 0); /* Clear register value. */ + + /* + * VPD registers start at offset 0x100. Read them. + */ + val = 0x100 + reg * 4; + AE_WRITE_4(sc, AE_VPD_CAP_REG, (val << AE_VPD_CAP_ADDR_SHIFT) & + AE_VPD_CAP_ADDR_MASK); + for (i = 0; i < AE_VPD_TIMEOUT; i++) { + DELAY(2000); + val = AE_READ_4(sc, AE_VPD_CAP_REG); + if ((val & AE_VPD_CAP_DONE) != 0) + break; + } + if (i == AE_VPD_TIMEOUT) { + device_printf(sc->dev, "timeout reading VPD register %d.\n", + reg); + return (ETIMEDOUT); + } + *word = AE_READ_4(sc, AE_VPD_DATA_REG); + return (0); +} + +static int +ae_get_vpd_eaddr(ae_softc_t *sc, uint32_t *eaddr) +{ + uint32_t word, reg, val; + int error; + int found; + int vpdc; + int i; + + KASSERT(sc != NULL, ("[ae, %d]: sc is NULL", __LINE__)); + KASSERT(eaddr != NULL, ("[ae, %d]: eaddr is NULL", __LINE__)); + + /* + * Check for EEPROM. + */ + error = ae_check_eeprom_present(sc, &vpdc); + if (error != 0) + return (error); + + /* + * Read the VPD configuration space. + * Each register is prefixed with signature, + * so we can check if it is valid. + */ + for (i = 0, found = 0; i < AE_VPD_NREGS; i++) { [... truncated: 5936 lines follow ...] From korli at mail.berlios.de Sat Dec 13 13:35:55 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Sat, 13 Dec 2008 13:35:55 +0100 Subject: [Haiku-commits] r28805 - haiku/trunk/src/servers/input Message-ID: <200812131235.mBDCZtsi009314@sheep.berlios.de> Author: korli Date: 2008-12-13 13:35:54 +0100 (Sat, 13 Dec 2008) New Revision: 28805 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28805&view=rev Modified: haiku/trunk/src/servers/input/InputServer.cpp Log: fix noticed by Olivier Cortes Modified: haiku/trunk/src/servers/input/InputServer.cpp =================================================================== --- haiku/trunk/src/servers/input/InputServer.cpp 2008-12-13 12:29:46 UTC (rev 28804) +++ haiku/trunk/src/servers/input/InputServer.cpp 2008-12-13 12:35:54 UTC (rev 28805) @@ -736,7 +736,7 @@ fKeys.num_key = key; break; case B_SCROLL_LOCK: - fKeys.num_key = key; + fKeys.scroll_key = key; break; case B_LEFT_SHIFT_KEY: fKeys.left_shift_key = key; From marcusoverhagen at arcor.de Sat Dec 13 22:29:39 2008 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Sat, 13 Dec 2008 22:29:39 +0100 (CET) Subject: [Haiku-commits] r28803 - haiku/trunk/src/add-ons/kernel/bus_managers/pci In-Reply-To: <200812130230.mBD2U8dO020906@sheep.berlios.de> References: <200812130230.mBD2U8dO020906@sheep.berlios.de> Message-ID: <24502461.1229203779521.JavaMail.ngmail@webmail08.arcor-online.net> mmu_man at BerliOS schrieb: > return a proper error after the panic when no device is found, and avoid a > leak. Shouldn't happen anyway, but doesn't hurt. Why why why why ??? Please don't do such changes. A panic clearly indicates that this function is not supposed to fail ever. (see r25867 commit comment) Code after a panic is never executed anyway, and leaking memory because of a panic is a non-issue. Marcus Jetzt komfortabel bei Arcor-Digital TV einsteigen: Mehr Happy Ends, mehr Herzschmerz, mehr Fernsehen! Erleben Sie 50 digitale TV Programme und optional 60 Pay TV Sender, einen elektronischen Programmf?hrer mit Movie Star Bewertungen von TV Movie. Au?erdem, aktuelle Filmhits und spannende Dokus in der Arcor-Videothek. Infos unter www.arcor.de/tv From korli at mail.berlios.de Sat Dec 13 23:17:50 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Sat, 13 Dec 2008 23:17:50 +0100 Subject: [Haiku-commits] r28806 - haiku/trunk/src/add-ons/opengl/mesa_software_renderer Message-ID: <200812132217.mBDMHoGU009652@sheep.berlios.de> Author: korli Date: 2008-12-13 23:17:50 +0100 (Sat, 13 Dec 2008) New Revision: 28806 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28806&view=rev Modified: haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h Log: mimic a swap on flush events to force display in single buffering mode (and glSwapBuffers would not be called). Modified: haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp =================================================================== --- haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp 2008-12-13 12:35:54 UTC (rev 28805) +++ haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.cpp 2008-12-13 22:17:50 UTC (rev 28806) @@ -236,7 +236,7 @@ const GLint blue = rgbFlag ? 8 : 0; const GLint alpha = alphaFlag ? 8 : 0; - //fOptions = options | BGL_INDIRECT; + fOptions = options; // | BGL_INDIRECT; struct dd_function_table functions; fVisual = _mesa_create_visual(rgbFlag, dblFlag, stereoFlag, red, green, @@ -253,6 +253,7 @@ //functions.ClearColor = ClearColor; functions.Error = Error; functions.Viewport = Viewport; + functions.Flush = Flush; // create core context fContext = _mesa_create_context(fVisual, NULL, &functions, this); @@ -420,6 +421,9 @@ { CALLED(); _mesa_make_current(fContext, NULL, NULL); + if ((fOptions & BGL_DOUBLE) == 0) { + SwapBuffers(); + } BGLRenderer::UnlockGL(); } @@ -771,3 +775,13 @@ } +void +MesaSoftwareRenderer::Flush(GLcontext *ctx) +{ + CALLED(); + MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx; + if ((mr->fOptions & BGL_DOUBLE) == 0) { + mr->SwapBuffers(); + } +} + Modified: haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h =================================================================== --- haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h 2008-12-13 12:35:54 UTC (rev 28805) +++ haiku/trunk/src/add-ons/opengl/mesa_software_renderer/MesaSoftwareRenderer.h 2008-12-13 22:17:50 UTC (rev 28806) @@ -58,11 +58,13 @@ struct gl_renderbuffer* render, GLenum internalFormat, GLuint width, GLuint height); + static void Flush(GLcontext *ctx); BBitmap* fBitmap; bool fDirectModeEnabled; direct_buffer_info* fInfo; BLocker fInfoLocker; + ulong fOptions; GLcontext* fContext; GLvisual* fVisual; From colacoder at mail.berlios.de Sat Dec 13 23:29:02 2008 From: colacoder at mail.berlios.de (colacoder at mail.berlios.de) Date: Sat, 13 Dec 2008 23:29:02 +0100 Subject: [Haiku-commits] r28807 - haiku/trunk/src/add-ons/kernel/bus_managers/acpi Message-ID: <200812132229.mBDMT28D010838@sheep.berlios.de> Author: colacoder Date: 2008-12-13 23:29:01 +0100 (Sat, 13 Dec 2008) New Revision: 28807 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28807&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c Log: Disabled B_FIND_CHILD_ON_DEMAND for ACPI nodes for now, so more then just level 2 ACPI nodes get a chance to have drivers assigned to them too ;) Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c 2008-12-13 22:17:50 UTC (rev 28806) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c 2008-12-13 22:29:01 UTC (rev 28807) @@ -105,7 +105,7 @@ "hid_%" ACPI_DEVICE_HID_ITEM "%" }}, { B_DRIVER_MAPPING "/0", B_STRING_TYPE, { string: "type_%" ACPI_DEVICE_TYPE_ITEM "%" }},*/ - { B_DEVICE_FLAGS, B_UINT32_TYPE, { ui32: B_FIND_CHILD_ON_DEMAND|B_FIND_MULTIPLE_CHILDREN }}, + { B_DEVICE_FLAGS, B_UINT32_TYPE, { ui32: /*B_FIND_CHILD_ON_DEMAND|*/B_FIND_MULTIPLE_CHILDREN }}, { NULL } }; @@ -133,7 +133,7 @@ // consumer specification /*{ B_DRIVER_MAPPING, B_STRING_TYPE, { string: "type_%" ACPI_DEVICE_TYPE_ITEM "%" }},*/ - { B_DEVICE_FLAGS, B_UINT32_TYPE, { ui32: B_FIND_CHILD_ON_DEMAND|B_FIND_MULTIPLE_CHILDREN }}, + { B_DEVICE_FLAGS, B_UINT32_TYPE, { ui32: /*B_FIND_CHILD_ON_DEMAND|*/B_FIND_MULTIPLE_CHILDREN }}, { NULL } }; From oruizdorantes at mail.berlios.de Sun Dec 14 00:24:12 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Sun, 14 Dec 2008 00:24:12 +0100 Subject: [Haiku-commits] r28808 - in haiku/trunk: headers/private/bluetooth src/kits/bluetooth Message-ID: <200812132324.mBDNOCJL016151@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-14 00:24:11 +0100 (Sun, 14 Dec 2008) New Revision: 28808 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28808&view=rev Modified: haiku/trunk/headers/private/bluetooth/CommandManager.h haiku/trunk/src/kits/bluetooth/CommandManager.cpp Log: Add HCI command for retieving Local Device Class Modified: haiku/trunk/headers/private/bluetooth/CommandManager.h =================================================================== --- haiku/trunk/headers/private/bluetooth/CommandManager.h 2008-12-13 22:29:01 UTC (rev 28807) +++ haiku/trunk/headers/private/bluetooth/CommandManager.h 2008-12-13 23:24:11 UTC (rev 28808) @@ -1,11 +1,8 @@ /* * Copyright 2007-2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com * Copyright 2008 Mika Lindqvist - * * All rights reserved. Distributed under the terms of the MIT License. - * */ - #ifndef _COMMAND_MANAGER_H #define _COMMAND_MANAGER_H @@ -16,6 +13,7 @@ void* buildReadLocalName(size_t* outsize); void* buildWriteScan(uint8 scanmode, size_t* outsize); void* buildAuthEnable(uint8 auth, size_t* outsize); +void* buildReadClassOfDevice(size_t* outsize); /* LINK CONTROL */ void* buildRemoteNameRequest(bdaddr_t bdaddr,uint8 pscan_rep_mode, uint16 clock_offset, size_t* outsize); Modified: haiku/trunk/src/kits/bluetooth/CommandManager.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/CommandManager.cpp 2008-12-13 22:29:01 UTC (rev 28807) +++ haiku/trunk/src/kits/bluetooth/CommandManager.cpp 2008-12-13 23:24:11 UTC (rev 28808) @@ -66,6 +66,12 @@ } +void* buildReadClassOfDevice(size_t* outsize) +{ + return buildCommand(OGF_CONTROL_BASEBAND, OCF_READ_CLASS_OF_DEV, NULL, 0, outsize); +} + + void* buildWriteScan(uint8 scanmode, size_t* outsize) { struct hci_write_scan_enable* param; From oruizdorantes at mail.berlios.de Sun Dec 14 00:41:34 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Sun, 14 Dec 2008 00:41:34 +0100 Subject: [Haiku-commits] r28809 - in haiku/trunk: headers/os/bluetooth src/kits/bluetooth src/servers/bluetooth Message-ID: <200812132341.mBDNfY2w028928@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-14 00:41:32 +0100 (Sun, 14 Dec 2008) New Revision: 28809 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28809&view=rev Added: haiku/trunk/src/kits/bluetooth/DeviceClass.cpp Modified: haiku/trunk/headers/os/bluetooth/DeviceClass.h haiku/trunk/headers/os/bluetooth/RemoteDevice.h haiku/trunk/src/kits/bluetooth/DiscoveryListener.cpp haiku/trunk/src/kits/bluetooth/Jamfile haiku/trunk/src/kits/bluetooth/KitSupport.h haiku/trunk/src/kits/bluetooth/LocalDevice.cpp haiku/trunk/src/kits/bluetooth/RemoteDevice.cpp haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp Log: - Implement retrieval of Device Classes. - Implement DeviceClass for easy analisys of discovered devices's type. - Make harder the intantiation of RemoteDevices. Modified: haiku/trunk/headers/os/bluetooth/DeviceClass.h =================================================================== --- haiku/trunk/headers/os/bluetooth/DeviceClass.h 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/headers/os/bluetooth/DeviceClass.h 2008-12-13 23:41:32 UTC (rev 28809) @@ -9,52 +9,66 @@ namespace Bluetooth { +#define UNKNOWN_CLASS_OF_DEVICE 0x00 + + class DeviceClass { public: - - DeviceClass(int record) + DeviceClass(uint8 record[3]) { - this->record = record; + SetRecord(record); } - DeviceClass() + + DeviceClass(uint32 record) { - this->record = 0; + SetRecord(record); } - int GetServiceClasses() + DeviceClass(void) { - return (record & 0x00FFE000) >> 13; + this->record = UNKNOWN_CLASS_OF_DEVICE; } + void SetRecord(uint8 record[3]) + { + this->record = record[0]|record[1]<<8|record[2]<<16; + } - int GetMajorDeviceClass() + void SetRecord(uint32 record) { - return (record & 0x00001F00) >> 8; + this->record = record; } - - void GetMajorDeviceClass(BString* str) + uint GetServiceClass() { + return (record & 0x00FFE000) >> 13; + } + uint GetMajorDeviceClass() + { + return (record & 0x00001F00) >> 8; } - - int GetMinorDeviceClass() + uint GetMinorDeviceClass() { return (record & 0x000000FF) >> 2; } - - void GetMinorDeviceClass(BString* str) + bool IsUnknownDeviceClass() { + return (record == UNKNOWN_CLASS_OF_DEVICE); + } - } - + void GetServiceClass(BString&); + void GetMajorDeviceClass(BString&); + void GetMinorDeviceClass(BString&); + private: - int record; + uint32 record; + }; } Modified: haiku/trunk/headers/os/bluetooth/RemoteDevice.h =================================================================== --- haiku/trunk/headers/os/bluetooth/RemoteDevice.h 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/headers/os/bluetooth/RemoteDevice.h 2008-12-13 23:41:32 UTC (rev 28809) @@ -49,7 +49,7 @@ LocalDevice* GetLocalDeviceOwner(); RemoteDevice(const BString& address); - RemoteDevice(const bdaddr_t address); + RemoteDevice(const bdaddr_t address, uint8 record[3]); protected: /* called by Discovery[Listener|Agent] */ Added: haiku/trunk/src/kits/bluetooth/DeviceClass.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/DeviceClass.cpp 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/src/kits/bluetooth/DeviceClass.cpp 2008-12-13 23:41:32 UTC (rev 28809) @@ -0,0 +1,321 @@ +/* + * Copyright 2007-2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com + * + * All rights reserved. Distributed under the terms of the MIT License. + * + */ + +//#include +//#include +//#include +#include +//#include +//#include +//#include +// +//#include +//#include +// +// +//#include "KitSupport.h" + +namespace Bluetooth { + + +void +DeviceClass::GetServiceClass(BString& serviceClass) +{ + static const char *services[] = { "Positioning", "Networking", + "Rendering", "Capturing", "Object Transfer", + "Audio", "Telephony", "Information" }; + + serviceClass = "Service Classes: "; + + if (GetServiceClass() != 0) { + + for (uint s = 0; s < (sizeof(services) / sizeof(*services)); s++) { + if (GetServiceClass() & (1 << s)) { + serviceClass << services[s]; + if (s != 0) + serviceClass << ", "; + } + } + + } else + serviceClass << "Unspecified"; + +} + + +void +DeviceClass::GetMajorDeviceClass(BString& majorClass) +{ + static const char *major_devices[] = { "Miscellaneous", "Computer", "Phone", + "LAN Access", "Audio/Video", "Peripheral", "Imaging", "Uncategorized" }; + + majorClass << "Major Class: "; + + if (GetMajorDeviceClass() >= sizeof(major_devices) / sizeof(*major_devices)) + majorClass << "Invalid Device Class!\n"; + else + majorClass << major_devices[GetMajorDeviceClass()]; + +} + + +void +DeviceClass::GetMinorDeviceClass(BString& minorClass) +{ + uint major = GetMajorDeviceClass(); + uint minor = GetMinorDeviceClass(); + + minorClass << "Minor Class: "; + + switch (major) { + case 0: /* misc */ + minorClass << " -"; + break; + case 1: /* computer */ + switch(minor) { + case 0: + minorClass << "Uncategorized"; + break; + case 1: + minorClass << "Desktop workstation"; + break; + case 2: + minorClass << "Server"; + break; + case 3: + minorClass << "Laptop"; + break; + case 4: + minorClass << "Handheld"; + break; + case 5: + minorClass << "Palm"; + break; + case 6: + minorClass << "Wearable"; + break; + } + break; + case 2: /* phone */ + switch(minor) { + case 0: + minorClass << "Uncategorized"; + break; + case 1: + minorClass << "Cellular"; + break; + case 2: + minorClass << "Cordless"; + break; + case 3: + minorClass << "Smart phone"; + break; + case 4: + minorClass << "Wired modem or voice gateway"; + break; + case 5: + minorClass << "Common ISDN Access"; + break; + case 6: + minorClass << "Sim Card Reader"; + break; + } + break; + case 3: /* lan access */ + if (minor == 0) { + minorClass << "Uncategorized"; + break; + } + switch(minor / 8) { + case 0: + minorClass << "Fully available"; + break; + case 1: + minorClass << "1-17% utilized"; + break; + case 2: + minorClass << "17-33% utilized"; + break; + case 3: + minorClass << "33-50% utilized"; + break; + case 4: + minorClass << "50-67% utilized"; + break; + case 5: + minorClass << "67-83% utilized"; + break; + case 6: + minorClass << "83-99% utilized"; + break; + case 7: + minorClass << "No service available"; + break; + } + break; + case 4: /* audio/video */ + switch(minor) { + case 0: + minorClass << "Uncategorized"; + break; + case 1: + minorClass << "Device conforms to the Headset profile"; + break; + case 2: + minorClass << "Hands-free"; + break; + /* 3 is reserved */ + case 4: + minorClass << "Microphone"; + break; + case 5: + minorClass << "Loudspeaker"; + break; + case 6: + minorClass << "Headphones"; + break; + case 7: + minorClass << "Portable Audio"; + break; + case 8: + minorClass << "Car Audio"; + break; + case 9: + minorClass << "Set-top box"; + break; + case 10: + minorClass << "HiFi Audio Device"; + break; + case 11: + minorClass << "VCR"; + break; + case 12: + minorClass << "Video Camera"; + break; + case 13: + minorClass << "Camcorder"; + break; + case 14: + minorClass << "Video Monitor"; + break; + case 15: + minorClass << "Video Display and Loudspeaker"; + break; + case 16: + minorClass << "Video Conferencing"; + break; + /* 17 is reserved */ + case 18: + minorClass << "Gaming/Toy"; + break; + } + break; + case 5: /* peripheral */ { + switch(minor & 48) { + case 16: + minorClass << "Keyboard"; + if (minor & 15) + minorClass << "/"; + break; + case 32: + minorClass << "Pointing device"; + if (minor & 15) + minorClass << "/"; + break; + case 48: + minorClass << "Combo keyboard/pointing device"; + if (minor & 15) + minorClass << "/"; + break; + } + + switch(minor & 15) { + case 0: + break; + case 1: + minorClass << "Joystick"; + break; + case 2: + minorClass << "Gamepad"; + break; + case 3: + minorClass << "Remote control"; + break; + case 4: + minorClass << "Sensing device"; + break; + case 5: + minorClass << "Digitizer tablet"; + break; + case 6: + minorClass << "Card reader"; + break; + default: + minorClass << "(reserved)"; + break; + } + } + case 6: /* imaging */ + if (minor & 4) + minorClass << "Display"; + if (minor & 8) + minorClass << "Camera"; + if (minor & 16) + minorClass << "Scanner"; + if (minor & 32) + minorClass << "Printer"; + break; + case 7: /* wearable */ + switch(minor) { + case 1: + minorClass << "Wrist Watch"; + break; + case 2: + minorClass << "Pager"; + break; + case 3: + minorClass << "Jacket"; + break; + case 4: + minorClass << "Helmet"; + break; + case 5: + minorClass << "Glasses"; + break; + } + break; + case 8: /* toy */ + switch(minor) { + case 1: + minorClass << "Robot"; + break; + case 2: + minorClass << "Vehicle"; + break; + case 3: + minorClass << "Doll / Action Figure"; + break; + case 4: + minorClass << "Controller"; + break; + case 5: + minorClass << "Game"; + break; + } + break; + case 63: /* uncategorised */ + minorClass << ""; + break; + default: + minorClass << "Unknown (reserved) minor device class"; + break; + } + + +} + +} Modified: haiku/trunk/src/kits/bluetooth/DiscoveryListener.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/DiscoveryListener.cpp 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/src/kits/bluetooth/DiscoveryListener.cpp 2008-12-13 23:41:32 UTC (rev 28809) @@ -76,7 +76,6 @@ if (message->FindData("info", B_ANY_TYPE, 0, (const void**)&inquiryInfo, &size) == B_OK ) { - // Skip duplicated replies for (int32 index = 0 ; index < fRemoteDevicesList.CountItems(); index++) { @@ -92,14 +91,13 @@ duplicatedFound = true; break; - } - + } } if (!duplicatedFound) { // TODO: DeviceClass(inquiryInfo->dev_class[0] | inquiryInfo->dev_class[1]<<8 | inquiryInfo->dev_class[2]<<16 ) - rd = new RemoteDevice(inquiryInfo->bdaddr); + rd = new RemoteDevice(inquiryInfo->bdaddr, (uint8*)inquiryInfo->dev_class); fRemoteDevicesList.AddItem(rd); // keep all inquiry reported data rd->SetLocalDeviceOwner(fLocalDevice); @@ -108,9 +106,7 @@ rd->fScanMode = inquiryInfo->pscan_mode; rd->fClockOffset = inquiryInfo->clock_offset; - DeviceDiscovered( rd, DeviceClass(inquiryInfo->dev_class[0] | - inquiryInfo->dev_class[1]<<8 | - inquiryInfo->dev_class[2]<<16 )); + DeviceDiscovered( rd, rd->GetDeviceClass()); } } } Modified: haiku/trunk/src/kits/bluetooth/Jamfile =================================================================== --- haiku/trunk/src/kits/bluetooth/Jamfile 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/src/kits/bluetooth/Jamfile 2008-12-13 23:41:32 UTC (rev 28809) @@ -20,6 +20,7 @@ RemoteDevice.cpp CommandManager.cpp KitSupport.cpp + DeviceClass.cpp #UI PincodeWindow.cpp ConnectionIncoming.cpp Modified: haiku/trunk/src/kits/bluetooth/KitSupport.h =================================================================== --- haiku/trunk/src/kits/bluetooth/KitSupport.h 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/src/kits/bluetooth/KitSupport.h 2008-12-13 23:41:32 UTC (rev 28809) @@ -1,12 +1,7 @@ /* * Copyright 2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com - * * All rights reserved. Distributed under the terms of the MIT License. - * */ - - #include - BMessenger* _RetrieveBluetoothMessenger(void); Modified: haiku/trunk/src/kits/bluetooth/LocalDevice.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/LocalDevice.cpp 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/src/kits/bluetooth/LocalDevice.cpp 2008-12-13 23:41:32 UTC (rev 28809) @@ -244,8 +244,35 @@ LocalDevice::GetDeviceClass() { - return DeviceClass(0); + if (fDeviceClass.IsUnknownDeviceClass()) { + if (fMessenger == NULL) + return fDeviceClass; + + size_t size; + void* command = buildReadClassOfDevice(&size); + if (command == NULL) + return fDeviceClass; + + BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST); + BMessage reply; + const uint8* record; + ssize_t ssize; + + request.AddInt32("hci_id", hid); + request.AddData("raw command", B_ANY_TYPE, command, size); + request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); + request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_CLASS_OF_DEV)); + + if (fMessenger->SendMessage(&request, &reply) == B_OK && + reply.FindData("devclass", B_ANY_TYPE, 0, (const void**)&record, &ssize) == B_OK) { + + fDeviceClass.SetRecord(*record); + } + } + + return fDeviceClass; + } Modified: haiku/trunk/src/kits/bluetooth/RemoteDevice.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/RemoteDevice.cpp 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/src/kits/bluetooth/RemoteDevice.cpp 2008-12-13 23:41:32 UTC (rev 28809) @@ -4,6 +4,7 @@ * All rights reserved. Distributed under the terms of the MIT License. */ +#include #include #include #include @@ -156,15 +157,17 @@ /* Constructor */ -RemoteDevice::RemoteDevice(const bdaddr_t address) +RemoteDevice::RemoteDevice(const bdaddr_t address, uint8 record[3]) { fBdaddr = address; + fDeviceClass.SetRecord(record); fMessenger = _RetrieveBluetoothMessenger(); } RemoteDevice::RemoteDevice(const BString& address) { + fDeviceClass.SetRecord((uint32)0); fBdaddr = bdaddrUtils::FromString((const char *)address.String()); fMessenger = _RetrieveBluetoothMessenger(); } Modified: haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp =================================================================== --- haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp 2008-12-13 23:24:11 UTC (rev 28808) +++ haiku/trunk/src/servers/bluetooth/LocalDeviceImpl.cpp 2008-12-13 23:41:32 UTC (rev 28809) @@ -278,7 +278,32 @@ ClearWantedEvent(request); } break; + + case PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_CLASS_OF_DEV): + { + struct hci_read_dev_class_reply* classDev = (struct hci_read_dev_class_reply*)(event+1); + if (classDev->status == BT_OK) { + + reply.AddData("devclass", B_ANY_TYPE, &classDev->dev_class, sizeof(classDev->dev_class)); + reply.AddInt8("status", classDev->status); + + printf("Sending reply ... %ld\n",request->SendReply(&reply)); + reply.PrintToStream(); + + Output::Instance()->Post("Positive reply for getDeviceClass\n", BLACKBOARD_KIT); + + } else { + reply.AddInt8("status", classDev->status); + request->SendReply(&reply); + Output::Instance()->Post("Negative reply for getDeviceClass\n", BLACKBOARD_KIT); + } + + // This request is not gonna be used anymore + ClearWantedEvent(request); + } + break; + case PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_LOCAL_NAME): { struct hci_rp_read_local_name* readLocalName = (struct hci_rp_read_local_name*)(event+1); @@ -377,7 +402,6 @@ } break; - default: Output::Instance()->Post("Command Complete not handled\n", BLACKBOARD_KIT); break; @@ -560,8 +584,9 @@ { if (event->status == BT_OK) { + uint8 cod[3] = {0,0,0}; - ConnectionIncoming* iConnection = new ConnectionIncoming(new RemoteDevice(event->bdaddr)); + ConnectionIncoming* iConnection = new ConnectionIncoming(new RemoteDevice(event->bdaddr, cod)); iConnection->Show(); printf("%s: Address %s handle=%#x type=%d encrypt=%d\n", __FUNCTION__, bdaddrUtils::ToString(event->bdaddr), event->handle, event->link_type, event->encrypt_mode); From oruizdorantes at mail.berlios.de Sun Dec 14 00:47:11 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Sun, 14 Dec 2008 00:47:11 +0100 Subject: [Haiku-commits] r28810 - haiku/trunk/src/bin Message-ID: <200812132347.mBDNlBrW001240@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-14 00:47:10 +0100 (Sun, 14 Dec 2008) New Revision: 28810 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28810&view=rev Modified: haiku/trunk/src/bin/bt_dev_info.cpp haiku/trunk/src/bin/bt_discovery.cpp Log: - Show the class of device(for local and discovered ones). - Listeners do not need to inform about the LocalDevice handling to the Discovery Agent anymore. Modified: haiku/trunk/src/bin/bt_dev_info.cpp =================================================================== --- haiku/trunk/src/bin/bt_dev_info.cpp 2008-12-13 23:41:32 UTC (rev 28809) +++ haiku/trunk/src/bin/bt_dev_info.cpp 2008-12-13 23:47:10 UTC (rev 28810) @@ -13,11 +13,22 @@ static void -DumpInfo(LocalDevice &device) +DumpInfo(LocalDevice* device) { - printf("[LocalDevice] %s\t%s\n", (device.GetFriendlyName()).String(), - bdaddrUtils::ToString(device.GetBluetoothAddress())); + printf("[LocalDevice] %s\t%s\n", (device->GetFriendlyName()).String(), + bdaddrUtils::ToString(device->GetBluetoothAddress())); + BString classString; + DeviceClass cod = device->GetDeviceClass(); + + cod.GetServiceClass(classString); + classString << " |"; + cod.GetMajorDeviceClass(classString); + classString << " |"; + cod.GetMinorDeviceClass(classString); + printf("\t\t%s: \n", classString.String()); + + printf("Discovery %ld\n", device->SetDiscoverable(3)); } static status_t @@ -32,26 +43,25 @@ int main(int argc, char *argv[]) { - if(argc == 2) { + if (argc == 2) { // device specified LocalDevice* ld = LocalDevice::GetLocalDevice(atoi(argv[0])); if (ld == NULL) return LocalDeviceError(ENODEV); - DumpInfo(*ld); + DumpInfo(ld); } else if (argc == 1) { // show all devices LocalDevice* ld = NULL; printf("Listing %ld Bluetooth Local Devices ...\n", LocalDevice::GetLocalDeviceCount()); - for (uint32 index = 0 ; index < LocalDevice::GetLocalDeviceCount() ; index++) { ld = LocalDevice::GetLocalDevice(); if (ld == NULL) return LocalDeviceError(ENODEV); - DumpInfo(*ld); + DumpInfo(ld); } Modified: haiku/trunk/src/bin/bt_discovery.cpp =================================================================== --- haiku/trunk/src/bin/bt_discovery.cpp 2008-12-13 23:41:32 UTC (rev 28809) +++ haiku/trunk/src/bin/bt_discovery.cpp 2008-12-13 23:47:10 UTC (rev 28810) @@ -1,8 +1,6 @@ /* * Copyright 2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com - * * All rights reserved. Distributed under the terms of the MIT License. - * */ #include @@ -11,27 +9,35 @@ #include #include +#include #include #include - thread_id mainThread; class simpleDiscoveryListener : public DiscoveryListener { public: -simpleDiscoveryListener(LocalDevice *device) : DiscoveryListener() +simpleDiscoveryListener() : DiscoveryListener() { - /* TODO: Should not be needed */ - SetLocalDeviceOwner(device); + } void DeviceDiscovered(RemoteDevice* btDevice, DeviceClass cod) { + BString classString; + printf("\t%s: Device %s discovered.\n",__FUNCTION__, bdaddrUtils::ToString(btDevice->GetBluetoothAddress())); + + cod.GetServiceClass(classString); + classString << " |"; + cod.GetMajorDeviceClass(classString); + classString << " |"; + cod.GetMinorDeviceClass(classString); + printf("\t\t%s: \n", classString.String()); } @@ -69,7 +75,7 @@ (device->GetFriendlyName()).String(), bdaddrUtils::ToString(device->GetBluetoothAddress())); - simpleDiscoveryListener* dListener = new simpleDiscoveryListener(device); + simpleDiscoveryListener* dListener = new simpleDiscoveryListener(); dAgent->StartInquiry(BT_GIAC, dListener); From revol at free.fr Sat Dec 13 22:41:21 2008 From: revol at free.fr (=?utf-8?q?Fran=C3=A7ois?= Revol) Date: Sat, 13 Dec 2008 22:41:21 +0100 CET Subject: [Haiku-commits] r28803 - haiku/trunk/src/add-ons/kernel/bus_managers/pci In-Reply-To: <24502461.1229203779521.JavaMail.ngmail@webmail08.arcor-online.net> Message-ID: <13486646253-BeMail@laptop> > mmu_man at BerliOS schrieb: > > > return a proper error after the panic when no device is found, and > > avoid a > > leak. Shouldn't happen anyway, but doesn't hurt. > > Why why why why ??? Please don't do such changes. > > A panic clearly indicates that this function is not supposed to fail > ever. > (see r25867 commit comment) > > Code after a panic is never executed anyway, and leaking memory > because of a panic is a non-issue. Except when continuing... Fran?ois. From korli at mail.berlios.de Sun Dec 14 15:05:37 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Sun, 14 Dec 2008 15:05:37 +0100 Subject: [Haiku-commits] r28811 - haiku/trunk/src/add-ons/media/media-add-ons/multi_audio Message-ID: <200812141405.mBEE5bDt022799@sheep.berlios.de> Author: korli Date: 2008-12-14 15:05:36 +0100 (Sun, 14 Dec 2008) New Revision: 28811 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28811&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp Log: use control index as parameter id, instead of control id Modified: haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp 2008-12-13 23:47:10 UTC (rev 28810) +++ haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp 2008-12-14 14:05:36 UTC (rev 28811) @@ -1190,25 +1190,25 @@ multi_mix_value values[2]; info.values = values; info.item_count = 0; + multi_mix_control* controls = fDevice->MixControlInfo().controls; + int32 control_id = controls[id - 100].id; - id = id - 100; - if (*size < sizeof(float)) return B_ERROR; if (parameter->Type() == BParameter::B_CONTINUOUS_PARAMETER) { info.item_count = 1; - values[0].id = id; + values[0].id = control_id; if (parameter->CountChannels() == 2) { if (*size < 2*sizeof(float)) return B_ERROR; info.item_count = 2; - values[1].id = id + 1; + values[1].id = controls[id + 1 - 100].id; } } else if(parameter->Type() == BParameter::B_DISCRETE_PARAMETER) { info.item_count = 1; - values[0].id = id; + values[0].id = control_id; } if (info.item_count > 0) { @@ -1268,20 +1268,20 @@ multi_mix_value values[2]; info.values = values; info.item_count = 0; + multi_mix_control* controls = fDevice->MixControlInfo().controls; + int32 control_id = controls[id - 100].id; - id = id - 100; - if (parameter->Type() == BParameter::B_CONTINUOUS_PARAMETER) { for (uint32 i = 0; i < size / sizeof(float); i++) { PRINT(("SetParameterValue B_CONTINUOUS_PARAMETER value[%li] : %f\n", i, ((float*)value)[i])); } info.item_count = 1; - values[0].id = id; + values[0].id = control_id; values[0].gain = ((float*)value)[0]; if (parameter->CountChannels() == 2) { info.item_count = 2; - values[1].id = id + 1; + values[1].id = controls[id + 1 - 100].id; values[1].gain = ((float*)value)[1]; } } else if (parameter->Type() == BParameter::B_DISCRETE_PARAMETER) { @@ -1292,11 +1292,11 @@ BDiscreteParameter* discrete = (BDiscreteParameter*)parameter; if (discrete->CountItems() <= 2) { info.item_count = 1; - values[0].id = id; + values[0].id = control_id; values[0].enable = ((int32*)value)[0] == 1; } else { info.item_count = 1; - values[0].id = id; + values[0].id = control_id; values[0].mux = ((uint32*)value)[0]; } } @@ -1362,7 +1362,7 @@ if (controls[i].flags & B_MULTI_MIX_GROUP) { PRINT(("NEW_GROUP\n")); BParameterGroup* child = group->MakeGroup(name); - child->MakeNullParameter(controls[i].id, B_MEDIA_RAW_AUDIO, name, + child->MakeNullParameter(100 + i, B_MEDIA_RAW_AUDIO, name, B_WEB_BUFFER_OUTPUT); int32 num = 1; @@ -1379,7 +1379,7 @@ _ProcessMux(parameter, i); } else if (controls[i].flags & B_MULTI_MIX_GAIN) { PRINT(("NEW_GAIN\n")); - group->MakeContinuousParameter(100 + controls[i].id, + group->MakeContinuousParameter(100 + i, B_MEDIA_RAW_AUDIO, "", B_MASTER_GAIN, "dB", controls[i].gain.min_gain, controls[i].gain.max_gain, controls[i].gain.granularity); @@ -1401,10 +1401,10 @@ } else if (controls[i].flags & B_MULTI_MIX_ENABLE) { PRINT(("NEW_ENABLE\n")); if (controls[i].string == S_MUTE) { - group->MakeDiscreteParameter(100 + controls[i].id, + group->MakeDiscreteParameter(100 + i, B_MEDIA_RAW_AUDIO, name, B_MUTE); } else { - group->MakeDiscreteParameter(100 + controls[i].id, + group->MakeDiscreteParameter(100 + i, B_MEDIA_RAW_AUDIO, name, B_ENABLE); } if (numParameters > 0) { From korli at mail.berlios.de Sun Dec 14 15:43:50 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Sun, 14 Dec 2008 15:43:50 +0100 Subject: [Haiku-commits] r28812 - in haiku/trunk: headers/private/input src/kits/interface src/servers/input Message-ID: <200812141443.mBEEhopE027984@sheep.berlios.de> Author: korli Date: 2008-12-14 15:43:49 +0100 (Sun, 14 Dec 2008) New Revision: 28812 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28812&view=rev Modified: haiku/trunk/headers/private/input/InputServerTypes.h haiku/trunk/src/kits/interface/InterfaceDefs.cpp haiku/trunk/src/servers/input/InputServer.cpp haiku/trunk/src/servers/input/InputServer.h Log: added get_modifier_key() as proposed by Olivier Cortes. Thanks. Modified: haiku/trunk/headers/private/input/InputServerTypes.h =================================================================== --- haiku/trunk/headers/private/input/InputServerTypes.h 2008-12-14 14:05:36 UTC (rev 28811) +++ haiku/trunk/headers/private/input/InputServerTypes.h 2008-12-14 14:43:49 UTC (rev 28812) @@ -14,6 +14,7 @@ #define IS_SET_KEY_REPEAT_DELAY 'Isrd' #define IS_GET_KEY_INFO 'Igki' #define IS_GET_MODIFIERS 'Igmd' +#define IS_GET_MODIFIER_KEY 'Igmk' #define IS_SET_MODIFIER_KEY 'Ismk' #define IS_SET_KEYBOARD_LOCKS 'Iskl' #define IS_GET_MOUSE_SPEED 'Igms' Modified: haiku/trunk/src/kits/interface/InterfaceDefs.cpp =================================================================== --- haiku/trunk/src/kits/interface/InterfaceDefs.cpp 2008-12-14 14:05:36 UTC (rev 28811) +++ haiku/trunk/src/kits/interface/InterfaceDefs.cpp 2008-12-14 14:43:49 UTC (rev 28812) @@ -376,12 +376,10 @@ BMessage command(IS_GET_MOUSE_TYPE); BMessage reply; - _control_input_server_(&command, &reply); - - if (reply.FindInt32("mouse_type", type) != B_OK) - return B_ERROR; - - return B_OK; + status_t err = _control_input_server_(&command, &reply); + if (err != B_OK) + return err; + return reply.FindInt32("mouse_type", type); } @@ -391,7 +389,9 @@ BMessage command(IS_SET_MOUSE_TYPE); BMessage reply; - command.AddInt32("mouse_type", type); + status_t err = command.AddInt32("mouse_type", type); + if (err != B_OK) + return err; return _control_input_server_(&command, &reply); } @@ -404,11 +404,12 @@ const void *data = 0; ssize_t count; - _control_input_server_(&command, &reply); + status_t err = _control_input_server_(&command, &reply); + if (err == B_OK) + err = reply.FindData("mousemap", B_RAW_TYPE, &data, &count); + if (err != B_OK) + return err; - if (reply.FindData("mousemap", B_RAW_TYPE, &data, &count) != B_OK) - return B_ERROR; - memcpy(map, data, count); return B_OK; @@ -421,7 +422,9 @@ BMessage command(IS_SET_MOUSE_MAP); BMessage reply; - command.AddData("mousemap", B_RAW_TYPE, map, sizeof(mouse_map)); + status_t err = command.AddData("mousemap", B_RAW_TYPE, map, sizeof(mouse_map)); + if (err != B_OK) + return err; return _control_input_server_(&command, &reply); } @@ -432,8 +435,10 @@ BMessage command(IS_GET_CLICK_SPEED); BMessage reply; - _control_input_server_(&command, &reply); - + status_t err = _control_input_server_(&command, &reply); + if (err != B_OK) + return err; + if (reply.FindInt64("speed", speed) != B_OK) *speed = 500000; @@ -457,8 +462,10 @@ BMessage command(IS_GET_MOUSE_SPEED); BMessage reply; - _control_input_server_(&command, &reply); - + status_t err = _control_input_server_(&command, &reply); + if (err != B_OK) + return err; + if (reply.FindInt32("speed", speed) != B_OK) *speed = 65536; @@ -637,13 +644,34 @@ _control_input_server_(&command, &reply); - reply.FindInt16("id", (int16 *)&kid); + status_t err = reply.FindInt16("id", (int16 *)&kid); + if (err != B_OK) + return err; *id = kid; return B_OK; } +status_t +get_modifier_key(uint32 modifier, uint32 *key) +{ + BMessage command(IS_GET_MODIFIER_KEY); + BMessage reply; + uint32 rkey; + + command.AddInt32("modifier", modifier); + _control_input_server_(&command, &reply); + + status_t err = reply.FindInt32("key", (int32 *) &rkey); + if (err != B_OK) + return err; + *key = rkey; + + return B_OK; +} + + void set_modifier_key(uint32 modifier, uint32 key) { Modified: haiku/trunk/src/servers/input/InputServer.cpp =================================================================== --- haiku/trunk/src/servers/input/InputServer.cpp 2008-12-14 14:05:36 UTC (rev 28811) +++ haiku/trunk/src/servers/input/InputServer.cpp 2008-12-14 14:43:49 UTC (rev 28812) @@ -520,6 +520,9 @@ case IS_GET_MODIFIERS: status = HandleGetModifiers(message, &reply); break; + case IS_GET_MODIFIER_KEY: + status = HandleGetModifierKey(message, &reply); + break; case IS_SET_MODIFIER_KEY: status = HandleSetModifierKey(message, &reply); break; @@ -723,6 +726,43 @@ status_t +InputServer::HandleGetModifierKey(BMessage* message, BMessage* reply) +{ + int32 modifier; + + if (message->FindInt32("modifier", &modifier) == B_OK) { + switch (modifier) { + case B_CAPS_LOCK: + return reply->AddInt32("key", fKeys.caps_key); + case B_NUM_LOCK: + return reply->AddInt32("key", fKeys.num_key); + case B_SCROLL_LOCK: + return reply->AddInt32("key", fKeys.scroll_key); + case B_LEFT_SHIFT_KEY: + return reply->AddInt32("key", fKeys.left_shift_key); + case B_RIGHT_SHIFT_KEY: + return reply->AddInt32("key", fKeys.right_shift_key); + case B_LEFT_COMMAND_KEY: + return reply->AddInt32("key", fKeys.left_command_key); + case B_RIGHT_COMMAND_KEY: + return reply->AddInt32("key", fKeys.right_command_key); + case B_LEFT_CONTROL_KEY: + return reply->AddInt32("key", fKeys.left_control_key); + case B_RIGHT_CONTROL_KEY: + return reply->AddInt32("key", fKeys.right_control_key); + case B_LEFT_OPTION_KEY: + return reply->AddInt32("key", fKeys.left_option_key); + case B_RIGHT_OPTION_KEY: + return reply->AddInt32("key", fKeys.right_option_key); + case B_MENU_KEY: + return reply->AddInt32("key", fKeys.menu_key); + } + } + return B_ERROR; +} + + +status_t InputServer::HandleSetModifierKey(BMessage* message, BMessage* reply) { int32 modifier, key; Modified: haiku/trunk/src/servers/input/InputServer.h =================================================================== --- haiku/trunk/src/servers/input/InputServer.h 2008-12-14 14:05:36 UTC (rev 28811) +++ haiku/trunk/src/servers/input/InputServer.h 2008-12-14 14:43:49 UTC (rev 28812) @@ -131,6 +131,7 @@ status_t HandleGetSetKeyRepeatDelay(BMessage* message, BMessage* reply); status_t HandleGetKeyInfo(BMessage* message, BMessage* reply); status_t HandleGetModifiers(BMessage* message, BMessage* reply); + status_t HandleGetModifierKey(BMessage* message, BMessage* reply); status_t HandleSetModifierKey(BMessage* message, BMessage* reply); status_t HandleSetKeyboardLocks(BMessage* message, BMessage* reply); status_t HandleGetSetMouseSpeed(BMessage* message, BMessage* reply); From korli at mail.berlios.de Sun Dec 14 15:47:11 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Sun, 14 Dec 2008 15:47:11 +0100 Subject: [Haiku-commits] r28813 - haiku/trunk/headers/os/interface Message-ID: <200812141447.mBEElBKd028228@sheep.berlios.de> Author: korli Date: 2008-12-14 15:47:11 +0100 (Sun, 14 Dec 2008) New Revision: 28813 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28813&view=rev Modified: haiku/trunk/headers/os/interface/InterfaceDefs.h Log: added get_modifier_key() Modified: haiku/trunk/headers/os/interface/InterfaceDefs.h =================================================================== --- haiku/trunk/headers/os/interface/InterfaceDefs.h 2008-12-14 14:43:49 UTC (rev 28812) +++ haiku/trunk/headers/os/interface/InterfaceDefs.h 2008-12-14 14:47:11 UTC (rev 28813) @@ -347,6 +347,7 @@ status_t get_key_info(key_info* info); void get_key_map(key_map** _map, char** _keyBuffer); status_t get_keyboard_id(uint16* _id); +status_t get_modifier_key(uint32 modifier, uint32 *key); void set_modifier_key(uint32 modifier, uint32 key); void set_keyboard_locks(uint32 modifiers); From oruizdorantes at mail.berlios.de Sun Dec 14 17:22:24 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Sun, 14 Dec 2008 17:22:24 +0100 Subject: [Haiku-commits] r28814 - in haiku/trunk: headers/os/bluetooth src/kits/bluetooth Message-ID: <200812141622.mBEGMOSm005001@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-14 17:22:22 +0100 (Sun, 14 Dec 2008) New Revision: 28814 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28814&view=rev Modified: haiku/trunk/headers/os/bluetooth/DeviceClass.h haiku/trunk/src/kits/bluetooth/DeviceClass.cpp Log: Add method to dump all DeviceClass information in one single string Modified: haiku/trunk/headers/os/bluetooth/DeviceClass.h =================================================================== --- haiku/trunk/headers/os/bluetooth/DeviceClass.h 2008-12-14 14:47:11 UTC (rev 28813) +++ haiku/trunk/headers/os/bluetooth/DeviceClass.h 2008-12-14 16:22:22 UTC (rev 28814) @@ -65,7 +65,9 @@ void GetServiceClass(BString&); void GetMajorDeviceClass(BString&); void GetMinorDeviceClass(BString&); - + + void DumpDeviceClass(BString&); + private: uint32 record; Modified: haiku/trunk/src/kits/bluetooth/DeviceClass.cpp =================================================================== --- haiku/trunk/src/kits/bluetooth/DeviceClass.cpp 2008-12-14 14:47:11 UTC (rev 28813) +++ haiku/trunk/src/kits/bluetooth/DeviceClass.cpp 2008-12-14 16:22:22 UTC (rev 28814) @@ -314,8 +314,20 @@ minorClass << "Unknown (reserved) minor device class"; break; } +} +void +DeviceClass::DumpDeviceClass(BString& string) +{ + + GetServiceClass(string); + string << " | "; + GetMajorDeviceClass(string); + string << " | "; + GetMinorDeviceClass(string); + string << "."; + } } From korli at mail.berlios.de Tue Dec 16 00:32:28 2008 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 16 Dec 2008 00:32:28 +0100 Subject: [Haiku-commits] r28815 - haiku/trunk/src/add-ons/media/media-add-ons/multi_audio Message-ID: <200812152332.mBFNWSNV020229@sheep.berlios.de> Author: korli Date: 2008-12-16 00:32:19 +0100 (Tue, 16 Dec 2008) New Revision: 28815 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28815&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp Log: fix my last change for muxers controls Modified: haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp 2008-12-14 16:22:22 UTC (rev 28814) +++ haiku/trunk/src/add-ons/media/media-add-ons/multi_audio/MultiAudioNode.cpp 2008-12-15 23:32:19 UTC (rev 28815) @@ -1370,7 +1370,7 @@ } else if (controls[i].flags & B_MULTI_MIX_MUX) { PRINT(("NEW_MUX\n")); BDiscreteParameter* parameter = group->MakeDiscreteParameter( - 100 + controls[i].id, B_MEDIA_RAW_AUDIO, name, B_INPUT_MUX); + 100 + i, B_MEDIA_RAW_AUDIO, name, B_INPUT_MUX); if (numParameters > 0) { (group->ParameterAt(numParameters - 1))->AddOutput( group->ParameterAt(numParameters)); From axeld at mail.berlios.de Thu Dec 18 22:01:19 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 18 Dec 2008 22:01:19 +0100 Subject: [Haiku-commits] r28816 - haiku/trunk/src/add-ons/accelerants/s3 Message-ID: <200812182101.mBIL1Jbt005670@sheep.berlios.de> Author: axeld Date: 2008-12-18 22:01:18 +0100 (Thu, 18 Dec 2008) New Revision: 28816 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28816&view=rev Modified: haiku/trunk/src/add-ons/accelerants/s3/mode.cpp haiku/trunk/src/add-ons/accelerants/s3/savage_mode.cpp Log: Applied patch by Gerald Zajac: * Fix for a problem of the ProSavage chip when VESA ran 32 bit before. * Better error codes in SetDisplayMode(). Modified: haiku/trunk/src/add-ons/accelerants/s3/mode.cpp =================================================================== --- haiku/trunk/src/add-ons/accelerants/s3/mode.cpp 2008-12-15 23:32:19 UTC (rev 28815) +++ haiku/trunk/src/add-ons/accelerants/s3/mode.cpp 2008-12-18 21:01:18 UTC (rev 28816) @@ -332,10 +332,10 @@ uint32 maxPixelClock; if ( ! gInfo.GetColorSpaceParams(mode.space, mode.bpp, maxPixelClock)) - return B_ERROR; + return B_BAD_VALUE; if (ProposeDisplayMode(&mode, pMode, pMode) != B_OK) - return B_ERROR; + return B_BAD_VALUE; // Note that for some Savage chips, accelerated drawing is badly messed up // when the display width is 1400 because 1400 is not evenly divisible by 32. @@ -357,7 +357,7 @@ // Is there enough frame buffer memory for this mode? if ( ! IsThereEnoughFBMemory(&mode, mode.bpp)) - return B_ERROR; + return B_NO_MEMORY; TRACE("Set display mode: %dx%d virtual size: %dx%d color depth: %d bpp\n", mode.timing.h_display, mode.timing.v_display, Modified: haiku/trunk/src/add-ons/accelerants/s3/savage_mode.cpp =================================================================== --- haiku/trunk/src/add-ons/accelerants/s3/savage_mode.cpp 2008-12-15 23:32:19 UTC (rev 28815) +++ haiku/trunk/src/add-ons/accelerants/s3/savage_mode.cpp 2008-12-18 21:01:18 UTC (rev 28816) @@ -525,10 +525,14 @@ WriteCrtcReg(0x67, regRec.CR67 & ~0x0e); // no STREAMS yet old and new // Set register SR19 to zero so that the ProSavage chips will start up - // when booting under BeOS using the default boot screen. + // when booting under BeOS using the default boot screen, and set register + // CR5F to zero so that the ProSavage chips will start up when Haiku boot + // screen had a depth of 32 bits/pixel - if (si.chipType == S3_PROSAVAGE || si.chipType == S3_TWISTER) + if (si.chipType == S3_PROSAVAGE || si.chipType == S3_TWISTER) { WriteSeqReg(0x19, 0); + WriteCrtcReg(0x5f, 0); + } // Clear bit 3 in SR30 so that Savage MX chip will startup. If bit 3 is // not cleared, it will startup only if booting under BeOS using the From anevilyak at mail.berlios.de Fri Dec 19 23:47:42 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Fri, 19 Dec 2008 23:47:42 +0100 Subject: [Haiku-commits] r28817 - haiku/trunk/src/servers/net Message-ID: <200812192247.mBJMlgdS014508@sheep.berlios.de> Author: anevilyak Date: 2008-12-19 23:47:41 +0100 (Fri, 19 Dec 2008) New Revision: 28817 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28817&view=rev Modified: haiku/trunk/src/servers/net/DHCPClient.cpp Log: Patch by Adrian Panasiuk: Initialize the renewal time before starting the message runner. This fixes a timing race that would trigger on some DHCP servers and result in constant renewal requests (Ticket #2531). Thanks! Modified: haiku/trunk/src/servers/net/DHCPClient.cpp =================================================================== --- haiku/trunk/src/servers/net/DHCPClient.cpp 2008-12-18 21:01:18 UTC (rev 28816) +++ haiku/trunk/src/servers/net/DHCPClient.cpp 2008-12-19 22:47:41 UTC (rev 28817) @@ -569,9 +569,9 @@ if (fRebindingTime == 0) fRebindingTime = fLeaseTime * 5/6; + bigtime_t now = system_time(); _RestartLease(fRenewalTime); - bigtime_t now = system_time(); fLeaseTime += now; fRenewalTime += now; fRebindingTime += now; From oruizdorantes at mail.berlios.de Sun Dec 21 20:14:48 2008 From: oruizdorantes at mail.berlios.de (oruizdorantes at BerliOS) Date: Sun, 21 Dec 2008 20:14:48 +0100 Subject: [Haiku-commits] r28818 - haiku/trunk/src/add-ons/kernel/network/protocols/l2cap Message-ID: <200812211914.mBLJEmt6007979@sheep.berlios.de> Author: oruizdorantes Date: 2008-12-21 20:14:47 +0100 (Sun, 21 Dec 2008) New Revision: 28818 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28818&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp Log: Fix Null access at request ident, reported by Mika Lindqvist Modified: haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp 2008-12-19 22:47:41 UTC (rev 28817) +++ haiku/trunk/src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp 2008-12-21 19:14:47 UTC (rev 28818) @@ -1044,7 +1044,7 @@ { L2capFrame* cmd = NULL; - cmd = btCoreData->SpawnSignal(conn, NULL, l2cap_cmd_rej(cmd->ident, reason, mtu, scid, dcid), ident, L2CAP_CMD_REJ); + cmd = btCoreData->SpawnSignal(conn, NULL, l2cap_cmd_rej(ident, reason, mtu, scid, dcid), ident, L2CAP_CMD_REJ); if (cmd == NULL) return ENOMEM; @@ -1060,7 +1060,7 @@ { L2capFrame* cmd = NULL; - cmd = btCoreData->SpawnSignal(conn, NULL, l2cap_con_rsp(cmd->ident, scid, dcid, result, 0), ident, L2CAP_CON_RSP); + cmd = btCoreData->SpawnSignal(conn, NULL, l2cap_con_rsp(ident, scid, dcid, result, 0), ident, L2CAP_CON_RSP); if (cmd == NULL) return ENOMEM; @@ -1076,7 +1076,7 @@ { L2capFrame* cmd = NULL; - cmd = btCoreData->SpawnSignal(conn, NULL, l2cap_cfg_rsp(cmd->ident, scid, 0, result, opt), + cmd = btCoreData->SpawnSignal(conn, NULL, l2cap_cfg_rsp(ident, scid, 0, result, opt), ident, L2CAP_CFG_RSP); if (cmd == NULL) { gBufferModule->free(opt); From mmu_man at mail.berlios.de Mon Dec 22 00:41:22 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 22 Dec 2008 00:41:22 +0100 Subject: [Haiku-commits] r28819 - haiku/trunk/src/bin Message-ID: <200812212341.mBLNfMYA011440@sheep.berlios.de> Author: mmu_man Date: 2008-12-22 00:41:20 +0100 (Mon, 22 Dec 2008) New Revision: 28819 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28819&view=rev Modified: haiku/trunk/src/bin/badblocks.c Log: Handle passing start and end block Modified: haiku/trunk/src/bin/badblocks.c =================================================================== --- haiku/trunk/src/bin/badblocks.c 2008-12-21 19:14:47 UTC (rev 28818) +++ haiku/trunk/src/bin/badblocks.c 2008-12-21 23:41:20 UTC (rev 28819) @@ -10,13 +10,14 @@ int group = 64; int progress = 1; int verbose = 0; +FILE *outputFile = stdout; -int scan_device(const char *dev) +int scan_device(const char *dev, off_t startBlock, off_t endBlock) { char *buffer = NULL; size_t len = group * blockSize; - off_t at = 0LL; - off_t block = 0L; + off_t block = startBlock; + off_t at = block * blockSize; int i; int fd; @@ -32,36 +33,46 @@ } // Check size + if (verbose) + fprintf(stderr, "Scanning '%s', %d * %d bytes at once\n", + dev, group, blockSize); + if (progress) fprintf(stderr, "\n"); - for (; ; block += group, at += len) { + for (; block <= endBlock; block += group, at += len) { int got; if (progress) - fprintf(stderr, "\033[Achecking %Ld\n", block); + fprintf(stderr, "checking block %Ld\x1b[1A\n", block); got = pread(fd, buffer, len, at); if (got == len) continue; if (got >= 0) { if (verbose) - fprintf(stderr, "at %Ld got %d < %d\n", at, got, len); + fprintf(stderr, "block %Ld (offset %Ld): got %d < %d\n", + block, at, got, len); break; } if (got < 0) { - fprintf(stderr, "error: %s\n", strerror(errno)); + fprintf(stderr, "block %Ld: error: %s\n", block, strerror(errno)); + /* if (errno != EIO && errno != ENXIO) { perror("pread"); goto err2; } + */ } // try each block separately for (i = 0; i < group; i++) { got = pread(fd, buffer, blockSize, at + blockSize * i); if (got == blockSize) continue; - if (got < 0) { - fprintf(stderr, "error: %s\n", strerror(errno)); - printf("%Ld\n", block); + if (got < blockSize) { + if (got < 0) + fprintf(stderr, "block %Ld: error: %s\n", block + i, strerror(errno)); + else + fprintf(stderr, "block %Ld: read % bytes\n", block + i, got); + fprintf(outputFile, "%Ld\n", block + i); fflush(stdout); } } @@ -79,13 +90,16 @@ int usage(int ret) { - fprintf(stderr, "badblocks [-sv] [-b block-size] [-c block-at-once] /dev/disk/...\n"); + fprintf(stderr, "badblocks [-sv] [-b block-size] [-c block-at-once] " + "/dev/disk/... [end-block [start-block]]\n"); return ret; } int main(int argc, char **argv) { int ch; + off_t startBlock = 0LL; + off_t endBlock = INT64_MAX; if (argc < 2) return usage(1); @@ -115,8 +129,10 @@ argc -= optind; argv += optind; - for (; argc > 0; argc--, argv++) { - scan_device(argv[0]); - } - return 0; + if (argc > 2) + startBlock = atoll(argv[2]); + if (argc > 1) + endBlock = atoll(argv[1]); + + return scan_device(argv[0], startBlock, endBlock); } From anevilyak at mail.berlios.de Tue Dec 23 05:42:44 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Tue, 23 Dec 2008 05:42:44 +0100 Subject: [Haiku-commits] r28820 - haiku/trunk/build/jam Message-ID: <200812230442.mBN4giLQ022171@sheep.berlios.de> Author: anevilyak Date: 2008-12-23 05:42:43 +0100 (Tue, 23 Dec 2008) New Revision: 28820 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28820&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: Fix incorrect symlink path. Thanks to Urias McCullough for reporting. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2008-12-21 23:41:20 UTC (rev 28819) +++ haiku/trunk/build/jam/OptionalPackages 2008-12-23 04:42:43 UTC (rev 28820) @@ -469,7 +469,7 @@ : apps ; AddSymlinkToHaikuImage home config be Applications - : /boot/apps/Vision-0.9.7-H-18072008/Vision ; + : /boot/apps/Vision-0.9.7-H-21072008/Vision ; } else { InstallOptionalHaikuImagePackage Vision-0.9.7-H-01112008 : http://vision.sf.net/Vision-0.9.7-H-01112008.zip From mmu_man at mail.berlios.de Wed Dec 24 03:48:26 2008 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 24 Dec 2008 03:48:26 +0100 Subject: [Haiku-commits] r28821 - haiku/trunk/build/jam Message-ID: <200812240248.mBO2mQkO013965@sheep.berlios.de> Author: mmu_man Date: 2008-12-24 03:48:25 +0100 (Wed, 24 Dec 2008) New Revision: 28821 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28821&view=rev Modified: haiku/trunk/build/jam/OptionalPackages Log: These non-GUI packages should also work with gcc4. Modified: haiku/trunk/build/jam/OptionalPackages =================================================================== --- haiku/trunk/build/jam/OptionalPackages 2008-12-23 04:42:43 UTC (rev 28820) +++ haiku/trunk/build/jam/OptionalPackages 2008-12-24 02:48:25 UTC (rev 28821) @@ -51,8 +51,6 @@ if [ IsOptionalHaikuImagePackageAdded APR ] { if $(TARGET_ARCH) != x86 { Echo "No optional package APR available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package APR available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; InstallOptionalHaikuImagePackage apr-0.9.17-gcc2-2008-05-20 @@ -67,8 +65,6 @@ if [ IsOptionalHaikuImagePackageAdded APR-util ] { if $(TARGET_ARCH) != x86 { Echo "No optional package APR-util available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package APR-util available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; InstallOptionalHaikuImagePackage apr-util-0.9.15-gcc2-2008-05-15 @@ -161,8 +157,6 @@ if [ IsOptionalHaikuImagePackageAdded CVS ] { if $(TARGET_ARCH) != x86 { Echo "No optional package CVS available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package CVS available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; InstallOptionalHaikuImagePackage cvs-1.12.13-gcc2-2008-12-04 @@ -328,8 +322,6 @@ if [ IsOptionalHaikuImagePackageAdded OpenSound ] { if $(TARGET_ARCH) != x86 { Echo "No optional package OpenSound available for $(TARGET_ARCH)" ; -# } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { -# Echo "No optional package OpenSound available for gcc4" ; } else { InstallOptionalHaikuImagePackage OpenSound : http://www.yellowbites.com/downloads/OpenSound_Haiku20080621.zip @@ -344,8 +336,6 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSH ] { if $(TARGET_ARCH) != x86 { Echo "No optional package OpenSSH available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package OpenSSH available for gcc4" ; } else { if ! $(HAIKU_IMAGE_HOST_NAME) { Exit "Optional package OpenSSH requires the HAIKU_IMAGE_HOST_NAME" @@ -368,8 +358,6 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] { if $(TARGET_ARCH) != x86 { Echo "No optional package OpenSSL available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package OpenSSL available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; InstallOptionalHaikuImagePackage openssl-0.9.8g-gcc2-2008-03-28 @@ -432,8 +420,6 @@ if [ IsOptionalHaikuImagePackageAdded Perl ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Perl available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package Perl available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; InstallOptionalHaikuImagePackage perl-5.10.0-gcc2-2008-10-29 @@ -448,8 +434,6 @@ if [ IsOptionalHaikuImagePackageAdded Subversion ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Subversion available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package Subversion available for gcc4" ; } else { InstallOptionalHaikuImagePackage Subversion : http://haiku.mlotz.ch/subversion-1.4.6-haiku-20080628.zip @@ -535,8 +519,6 @@ if [ IsOptionalHaikuImagePackageAdded Yasm ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Yasm available for $(TARGET_ARCH)" ; - } else if $(HAIKU_GCC_VERSION[1]) >= 4 && $(isHybridBuild) = 0 { - Echo "No optional package Yasm available for gcc4" ; } else { local baseURL = http://haiku-files.org/files/optional-packages ; InstallOptionalHaikuImagePackage yasm-0.7.2-gcc2-2008-11-25 From axeld at mail.berlios.de Fri Dec 26 17:10:11 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 26 Dec 2008 17:10:11 +0100 Subject: [Haiku-commits] r28822 - haiku/trunk/src/kits/shared Message-ID: <200812261610.mBQGABPr031204@sheep.berlios.de> Author: axeld Date: 2008-12-26 17:10:11 +0100 (Fri, 26 Dec 2008) New Revision: 28822 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28822&view=rev Modified: haiku/trunk/src/kits/shared/DateTime.cpp Log: * Removed svn:executable property. Property changes on: haiku/trunk/src/kits/shared/DateTime.cpp ___________________________________________________________________ Name: svn:executable - * From axeld at mail.berlios.de Sat Dec 27 21:37:55 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 27 Dec 2008 21:37:55 +0100 Subject: [Haiku-commits] r28823 - haiku/trunk/src/system/kernel Message-ID: <200812272037.mBRKbtLF025002@sheep.berlios.de> Author: axeld Date: 2008-12-27 21:37:55 +0100 (Sat, 27 Dec 2008) New Revision: 28823 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28823&view=rev Modified: haiku/trunk/src/system/kernel/Jamfile Log: * kernel.so must link agaist kernel_misc.o as well to make all of its symbols available for modules. Modified: haiku/trunk/src/system/kernel/Jamfile =================================================================== --- haiku/trunk/src/system/kernel/Jamfile 2008-12-26 16:10:11 UTC (rev 28822) +++ haiku/trunk/src/system/kernel/Jamfile 2008-12-27 20:37:55 UTC (rev 28823) @@ -135,6 +135,7 @@ kernel_os_arch_$(TARGET_ARCH).o kernel_lib_posix.o kernel_lib_posix_arch_$(TARGET_ARCH).o + kernel_misc.o $(HAIKU_STATIC_LIBSUPC++) From axeld at mail.berlios.de Sat Dec 27 21:41:07 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 27 Dec 2008 21:41:07 +0100 Subject: [Haiku-commits] r28824 - haiku/trunk/src/add-ons/kernel/network/stack Message-ID: <200812272041.mBRKf7PQ025298@sheep.berlios.de> Author: axeld Date: 2008-12-27 21:41:06 +0100 (Sat, 27 Dec 2008) New Revision: 28824 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28824&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/stack/link.cpp Log: * Minor cleanup, removed TODO that doesn't make much sense. Modified: haiku/trunk/src/add-ons/kernel/network/stack/link.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/link.cpp 2008-12-27 20:37:55 UTC (rev 28823) +++ haiku/trunk/src/add-ons/kernel/network/stack/link.cpp 2008-12-27 20:41:06 UTC (rev 28824) @@ -6,6 +6,7 @@ * Axel D?rfler, axeld at pinc-software.de */ +//! The net_protocol you talk to when using the AF_LINK protocol #include "datalink.h" #include "domains.h" @@ -52,7 +53,8 @@ net_device_monitor fMonitor; net_device_interface *fMonitoredDevice; - static status_t _MonitorData(net_device_monitor *monitor, net_buffer *buffer); + static status_t _MonitorData(net_device_monitor *monitor, + net_buffer *buffer); static void _MonitorEvent(net_device_monitor *monitor, int32 event); }; @@ -224,8 +226,6 @@ { LinkProtocol *protocol = (LinkProtocol *)_protocol; - // TODO All of this common functionality should be elsewhere - switch (option) { case SIOCGIFINDEX: { @@ -234,7 +234,8 @@ if (user_memcpy(&request, value, IF_NAMESIZE) < B_OK) return B_BAD_ADDRESS; - net_device_interface *interface = get_device_interface(request.ifr_name); + net_device_interface *interface + = get_device_interface(request.ifr_name); if (interface != NULL) { request.ifr_index = interface->device->index; put_device_interface(interface); @@ -250,7 +251,8 @@ if (user_memcpy(&request, value, sizeof(struct ifreq)) < B_OK) return B_BAD_ADDRESS; - net_device_interface *interface = get_device_interface(request.ifr_index); + net_device_interface *interface + = get_device_interface(request.ifr_index); if (interface != NULL) { strlcpy(request.ifr_name, interface->device->name, IF_NAMESIZE); put_device_interface(interface); @@ -291,7 +293,8 @@ if (user_memcpy(&request, value, IF_NAMESIZE) < B_OK) return B_BAD_ADDRESS; - net_device_interface *interface = get_device_interface(request.ifr_name); + net_device_interface *interface + = get_device_interface(request.ifr_name); if (interface != NULL) { get_device_interface_address(interface, &request.ifr_addr); put_device_interface(interface); @@ -473,7 +476,8 @@ void link_init() { - register_domain_protocols(AF_LINK, SOCK_DGRAM, 0, "network/stack/link/v1", NULL); + register_domain_protocols(AF_LINK, SOCK_DGRAM, 0, "network/stack/link/v1", + NULL); register_domain_datalink_protocols(AF_LINK, IFT_ETHER, "network/datalink_protocols/ethernet_frame/v1", From axeld at mail.berlios.de Sat Dec 27 21:48:29 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 27 Dec 2008 21:48:29 +0100 Subject: [Haiku-commits] r28825 - in haiku/trunk: build/jam headers/private/net src/add-ons/kernel/network/notifications src/add-ons/kernel/network/stack src/kits/network Message-ID: <200812272048.mBRKmT57025980@sheep.berlios.de> Author: axeld Date: 2008-12-27 21:48:28 +0100 (Sat, 27 Dec 2008) New Revision: 28825 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28825&view=rev Added: haiku/trunk/src/kits/network/notifications.cpp Modified: haiku/trunk/build/jam/HaikuImage haiku/trunk/headers/private/net/net_notifications.h haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h haiku/trunk/src/kits/network/Jamfile Log: * More or less completed the network notification module - it does not remove old invalid user listeners yet, though (ie. if a team dies). * Implemented userland network monitor functions. * Added a few notifications to the network stack, even though this part isn't complete yet (especially notify_interface_changed()). * Added optional debug output to the notifications module. * Added the module to the image, it basically works now (tested). Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/build/jam/HaikuImage 2008-12-27 20:48:28 UTC (rev 28825) @@ -138,12 +138,12 @@ $(X86_ONLY)s3 $(X86_ONLY)vesa #$(X86_ONLY)via #$(X86_ONLY)vmware ; BEOS_ADD_ONS_DRIVERS_MIDI = emuxki ; -BEOS_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)broadcom440x +BEOS_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x etherpci $(X86_ONLY)ipro1000 pegasus $(X86_ONLY)rtl8139 rtl8169 $(X86_ONLY)rtl81xx sis900 $(X86_ONLY)via_rhine wb840 $(X86_ONLY)ipro100 $(X86_ONLY)nforce #vlance - $(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect + $(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect $(X86_ONLY)attansic_l2 $(X86_ONLY)ar81xx usb_ecm ; #BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ; @@ -420,7 +420,8 @@ AddFilesToHaikuImage beos system add-ons input_server devices : keyboard mouse wacom ; AddFilesToHaikuImage beos system add-ons input_server filters : screen_saver ; -AddFilesToHaikuImage beos system add-ons kernel network : stack ; +AddFilesToHaikuImage beos system add-ons kernel network + : notifications stack ; AddFilesToHaikuImage beos system add-ons kernel network devices : $(BEOS_NETWORK_DEVICES) ; AddFilesToHaikuImage beos system add-ons kernel network datalink_protocols Modified: haiku/trunk/headers/private/net/net_notifications.h =================================================================== --- haiku/trunk/headers/private/net/net_notifications.h 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/headers/private/net/net_notifications.h 2008-12-27 20:48:28 UTC (rev 28825) @@ -24,8 +24,7 @@ // generic syscall interface #define NET_NOTIFICATIONS_SYSCALLS "network/notifications" -#define NET_NOTIFICATIONS_START_WATCHING 1 -#define NET_NOTIFICATIONS_STOP_WATCHING 2 +#define NET_NOTIFICATIONS_CONTROL_WATCHING 1 struct net_notifications_control { uint32 flags; @@ -36,15 +35,15 @@ // TODO: the following part of this header should end up in a public header // some day! -#define B_NETWORK_INTERFACE_ADDED 1 -#define B_NETWORK_INTERFACE_REMOVED 2 -#define B_NETWORK_INTERFACE_CHANGED 3 -#define B_NETWORK_DEVICE_LINK_CHANGED 4 +#define B_NETWORK_INTERFACE_ADDED 0x01 +#define B_NETWORK_INTERFACE_REMOVED 0x02 +#define B_NETWORK_INTERFACE_CHANGED 0x03 +#define B_NETWORK_DEVICE_LINK_CHANGED 0x10 // TODO: add routes, stack unloaded/loaded, ... events enum { - B_WATCH_NETWORK_INTERFACE_CHANGES = 0x0001, - B_WATCH_NETWORK_LINK_CHANGES = 0x0002 + B_WATCH_NETWORK_INTERFACE_CHANGES = 0x000f, + B_WATCH_NETWORK_LINK_CHANGES = 0x00f0 }; #define B_NETWORK_MONITOR '_NTN' Modified: haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/add-ons/kernel/network/notifications/notifications.cpp 2008-12-27 20:48:28 UTC (rev 28825) @@ -7,12 +7,18 @@ #include -//#include +#include #include #include +//#define TRACE_NOTIFICATIONS +#ifdef TRACE_NOTIFICATIONS +# define TRACE(x...) dprintf("\33[32mnet_notifications:\33[0m " x) +#else +# define TRACE(x...) ; +#endif -// TODO: add generic syscall interface +// TODO: add possibility to remove teams/ports that are gone static UserMessagingMessageSender sNotificationSender; @@ -75,8 +81,11 @@ net_listener::~net_listener() { - if (dynamic_cast(listener) != NULL) + // Only delete the listener if it's one of ours + if (dynamic_cast(listener) != NULL) { + TRACE("delete user listener %p\n", listener); delete listener; + } } @@ -101,21 +110,25 @@ void NetNotificationService::Notify(const KMessage& event) { - uint32 flags = event.GetInt32("flags", 0); - if (flags == 0) + uint32 opcode = event.GetInt32("opcode", 0); + if (opcode == 0) return; + TRACE("notify for %lx\n", opcode); + RecursiveLocker _(fRecursiveLock); ListenerList::Iterator iterator = fListeners.GetIterator(); while (net_listener* listener = iterator.Next()) { - if ((listener->flags & flags) != 0) + if ((listener->flags & opcode) != 0) { + TRACE(" notify listener %p for %lx\n", listener, opcode); listener->listener->EventOccured(*this, &event); + } } iterator = fListeners.GetIterator(); while (net_listener* listener = iterator.Next()) { - if ((listener->flags & flags) != 0) + if ((listener->flags & opcode) != 0) listener->listener->AllListenersNotified(*this); } } @@ -170,8 +183,14 @@ ListenerList::Iterator iterator = fListeners.GetIterator(); while (net_listener* listener = iterator.Next()) { if (listener->listener == ¬ificationListener) { + TRACE("remove listener %p\n", listener); iterator.Remove(); delete listener; + + if (fListeners.IsEmpty()) { + // Give up the reference _AddListener() + put_module(NET_NOTIFICATIONS_MODULE_NAME); + } return B_OK; } } @@ -180,7 +199,7 @@ } -inline status_t +status_t NetNotificationService::RemoveUserListeners(port_id port, uint32 token) { UserNetListener userListener(port, token); @@ -190,8 +209,14 @@ ListenerList::Iterator iterator = fListeners.GetIterator(); while (net_listener* listener = iterator.Next()) { if (*listener->listener == userListener) { + TRACE("remove user listener %p\n", listener); iterator.Remove(); delete listener; + + if (fListeners.IsEmpty()) { + // Give up the reference _AddListener() + put_module(NET_NOTIFICATIONS_MODULE_NAME); + } return B_OK; } } @@ -237,11 +262,22 @@ if (listener == NULL) return B_NO_MEMORY; + TRACE("add %slistener %p for %lx\n", + dynamic_cast(¬ificationListener) != NULL + ? "user " : "", listener, flags); + listener->flags = flags; listener->listener = ¬ificationListener; RecursiveLocker _(fRecursiveLock); + if (fListeners.IsEmpty()) { + // The reference counting doesn't work for us, as we'll have to + // ensure our module stays loaded. + module_info* dummy; + get_module(NET_NOTIFICATIONS_MODULE_NAME, &dummy); + } + fListeners.Add(listener); return B_OK; } @@ -250,27 +286,36 @@ // #pragma mark - User generic syscall -status_t -_user_start_watching_network(uint32 flags, port_id port, uint32 token) +static status_t +net_notifications_control(const char *subsystem, uint32 function, void *buffer, + size_t bufferSize) { - return sNotificationService.UpdateUserListener(flags, port, token); -} + struct net_notifications_control control; + if (bufferSize != sizeof(struct net_notifications_control) + || function != NET_NOTIFICATIONS_CONTROL_WATCHING) + return B_BAD_VALUE; + if (user_memcpy(&control, buffer, + sizeof(struct net_notifications_control)) < B_OK) + return B_BAD_ADDRESS; + if (control.flags != 0) { + return sNotificationService.UpdateUserListener(control.flags, + control.port, control.token); + } -status_t -_user_stop_watching_network(port_id port, uint32 token) -{ - return sNotificationService.RemoveUserListeners(port, token); + return sNotificationService.RemoveUserListeners(control.port, + control.token); } // #pragma mark - exported module API -static void +static status_t send_notification(const KMessage* event) { sNotificationService.Notify(*event); + return B_OK; } @@ -279,10 +324,20 @@ { switch (op) { case B_MODULE_INIT: + TRACE("init\n"); + new(&sNotificationSender) UserMessagingMessageSender(); new(&sNotificationService) NetNotificationService(); + + register_generic_syscall(NET_NOTIFICATIONS_SYSCALLS, + net_notifications_control, 1, 0); return B_OK; + case B_MODULE_UNINIT: + TRACE("uninit\n"); + + unregister_generic_syscall(NET_NOTIFICATIONS_SYSCALLS, 1); + sNotificationSender.~UserMessagingMessageSender(); sNotificationService.~NetNotificationService(); return B_OK; Modified: haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2008-12-27 20:48:28 UTC (rev 28825) @@ -518,7 +518,8 @@ status_t -interface_protocol_init(struct net_interface *_interface, net_datalink_protocol **_protocol) +interface_protocol_init(struct net_interface *_interface, + net_datalink_protocol **_protocol) { net_interface_private *interface = (net_interface_private *)_interface; @@ -547,7 +548,8 @@ net_buffer *buffer) { interface_protocol *protocol = (interface_protocol *)_protocol; - net_interface_private *interface = (net_interface_private *)protocol->interface; + net_interface_private *interface + = (net_interface_private *)protocol->interface; // TODO: Need to think about this locking. We can't obtain the // RX Lock here (nor would it make sense) as the ARP Modified: haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2008-12-27 20:48:28 UTC (rev 28825) @@ -186,8 +186,10 @@ put_device_interface(deviceInterface); - if (status == B_OK) + if (status == B_OK) { list_add_item(&domain->interfaces, interface); + notify_interface_added(interface); + } return status; } @@ -203,6 +205,7 @@ net_domain_private *domain = (net_domain_private *)interface->domain; list_remove_item(&domain->interfaces, interface); + notify_interface_removed(interface); delete_interface((net_interface_private *)interface); return B_OK; } Modified: haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp 2008-12-27 20:48:28 UTC (rev 28825) @@ -764,6 +764,7 @@ status_t device_link_changed(net_device *device) { + notify_link_changed(device); return B_OK; } Modified: haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/add-ons/kernel/network/stack/notifications.cpp 2008-12-27 20:48:28 UTC (rev 28825) @@ -9,6 +9,7 @@ notification listeners independent from the stack status. */ +#include #include #include @@ -20,7 +21,7 @@ status_t -notify_interface_added(const char* interface) +notify_interface_added(net_interface* interface) { if (sNotificationModule == NULL) return B_NOT_SUPPORTED; @@ -29,14 +30,14 @@ KMessage message; message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); message.AddInt32("opcode", B_NETWORK_INTERFACE_ADDED); - message.AddString("interface", interface); + message.AddString("interface", interface->name); return sNotificationModule->send_notification(&message); } status_t -notify_interface_removed(const char* interface) +notify_interface_removed(net_interface* interface) { if (sNotificationModule == NULL) return B_NOT_SUPPORTED; @@ -45,14 +46,14 @@ KMessage message; message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); message.AddInt32("opcode", B_NETWORK_INTERFACE_REMOVED); - message.AddString("interface", interface); + message.AddString("interface", interface->name); return sNotificationModule->send_notification(&message); } status_t -notify_interface_changed(const char* interface) +notify_interface_changed(net_interface* interface) { if (sNotificationModule == NULL) return B_NOT_SUPPORTED; @@ -61,14 +62,14 @@ KMessage message; message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); message.AddInt32("opcode", B_NETWORK_INTERFACE_CHANGED); - message.AddString("interface", interface); + message.AddString("interface", interface->name); return sNotificationModule->send_notification(&message); } status_t -notify_link_changed(const char* interface) +notify_link_changed(net_device* device) { if (sNotificationModule == NULL) return B_NOT_SUPPORTED; @@ -77,7 +78,10 @@ KMessage message; message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR); message.AddInt32("opcode", B_NETWORK_DEVICE_LINK_CHANGED); - message.AddString("interface", interface); + message.AddString("device", device->name); + message.AddInt32("media", device->media); + message.AddInt64("link speed", device->link_speed); + message.AddInt32("link quality", device->link_quality); return sNotificationModule->send_notification(&message); } Modified: haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/add-ons/kernel/network/stack/stack_private.h 2008-12-27 20:48:28 UTC (rev 28825) @@ -34,10 +34,10 @@ status_t put_domain_datalink_protocols(net_interface *interface); // notifications.cpp -status_t notify_interface_added(const char* interface); -status_t notify_interface_removed(const char* interface); -status_t notify_interface_changed(const char* interface); -status_t notify_link_changed(const char* interface); +status_t notify_interface_added(net_interface* interface); +status_t notify_interface_removed(net_interface* interface); +status_t notify_interface_changed(net_interface* interface); +status_t notify_link_changed(net_device* device); status_t init_notifications(); void uninit_notifications(); Modified: haiku/trunk/src/kits/network/Jamfile =================================================================== --- haiku/trunk/src/kits/network/Jamfile 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/kits/network/Jamfile 2008-12-27 20:48:28 UTC (rev 28825) @@ -1,14 +1,16 @@ SubDir HAIKU_TOP src kits network ; -UsePrivateHeaders libroot net shared ; +UsePrivateHeaders app libroot net shared ; UsePrivateSystemHeaders ; SharedLibrary libnetwork.so : init.cpp interfaces.cpp + notifications.cpp socket.cpp r5_compatibility.cpp : + be dns_dst.o dns_inet.o dns_irs.o Added: haiku/trunk/src/kits/network/notifications.cpp =================================================================== --- haiku/trunk/src/kits/network/notifications.cpp 2008-12-27 20:41:06 UTC (rev 28824) +++ haiku/trunk/src/kits/network/notifications.cpp 2008-12-27 20:48:28 UTC (rev 28825) @@ -0,0 +1,68 @@ +/* + * Copyright 2008, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ + +/*! The notifications API uses the generic syscall interface of the + network's stack notification module. +*/ + +#include + +#include +#include +#include + + +static status_t +check_for_notifications_syscall(void) +{ + uint32 version = 0; + return _kern_generic_syscall(NET_NOTIFICATIONS_SYSCALLS, B_SYSCALL_INFO, + &version, sizeof(version)); +} + + +// #pragma mark - + + +status_t +start_watching_network(uint32 flags, const BMessenger& target) +{ + if (check_for_notifications_syscall() != B_OK) + return B_NOT_SUPPORTED; + + BMessenger::Private targetPrivate(const_cast(target)); + net_notifications_control control; + control.flags = flags; + control.port = targetPrivate.Port(); + control.token = targetPrivate.Token(); + + return _kern_generic_syscall(NET_NOTIFICATIONS_SYSCALLS, + NET_NOTIFICATIONS_CONTROL_WATCHING, &control, + sizeof(net_notifications_control)); +} + + +status_t +start_watching_network(uint32 flags, const BHandler* handler, + const BLooper* looper) +{ + const BMessenger target(handler, looper); + return start_watching_network(flags, target); +} + +status_t +stop_watching_network(const BMessenger& target) +{ + return start_watching_network(0, target); + // start_watching_network() without flags just stops everything +} + + +status_t +stop_watching_network(const BHandler* handler, const BLooper* looper) +{ + const BMessenger target(handler, looper); + return stop_watching_network(target); +} From axeld at mail.berlios.de Sat Dec 27 23:12:09 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 27 Dec 2008 23:12:09 +0100 Subject: [Haiku-commits] r28826 - haiku/trunk/src/system/libroot/posix Message-ID: <200812272212.mBRMC9lw002764@sheep.berlios.de> Author: axeld Date: 2008-12-27 23:12:08 +0100 (Sat, 27 Dec 2008) New Revision: 28826 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28826&view=rev Modified: haiku/trunk/src/system/libroot/posix/syslog.cpp Log: * get_context() didn't quite do what it was supposed to be doing. Especially, it was not guaranteed that this function returned a valid context even with low memory. Modified: haiku/trunk/src/system/libroot/posix/syslog.cpp =================================================================== --- haiku/trunk/src/system/libroot/posix/syslog.cpp 2008-12-27 20:48:28 UTC (rev 28825) +++ haiku/trunk/src/system/libroot/posix/syslog.cpp 2008-12-27 22:12:08 UTC (rev 28826) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2003-2008, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -67,9 +67,7 @@ return &sTeamContext; } - *tls_address(slot) = allocate_context(); sThreadContextSlot = slot; - return (syslog_context *)tls_get(slot); } else { while (sThreadContextSlot == -1) snooze(10000); @@ -81,7 +79,7 @@ // try to allocate the context again; it might have // been deleted, or there was not enough memory last // time - context = allocate_context(); + *tls_address(sThreadContextSlot) = context = allocate_context(); } if (context != NULL) return context; From axeld at mail.berlios.de Sat Dec 27 23:15:17 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 27 Dec 2008 23:15:17 +0100 Subject: [Haiku-commits] r28827 - haiku/trunk/src/servers/net Message-ID: <200812272215.mBRMFHIr003423@sheep.berlios.de> Author: axeld Date: 2008-12-27 23:15:17 +0100 (Sat, 27 Dec 2008) New Revision: 28827 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28827&view=rev Added: haiku/trunk/src/servers/net/AutoconfigClient.cpp haiku/trunk/src/servers/net/AutoconfigClient.h Modified: haiku/trunk/src/servers/net/AutoconfigLooper.cpp haiku/trunk/src/servers/net/AutoconfigLooper.h haiku/trunk/src/servers/net/DHCPClient.cpp haiku/trunk/src/servers/net/DHCPClient.h haiku/trunk/src/servers/net/Jamfile haiku/trunk/src/servers/net/NetServer.cpp Log: * Pulled an AutoconfigClient class out of DHCPClient - all clients are supposed to inherit from that one (there is still just a single client, though, this just simplifies having a generic mechanism to register and use auto-config clients). * AutoconfigLooper now listens to link changes, and will reconfigure the interface if a new link is there - this even seems to work in emulation, will test on real hardware next. Added: haiku/trunk/src/servers/net/AutoconfigClient.cpp =================================================================== --- haiku/trunk/src/servers/net/AutoconfigClient.cpp 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/AutoconfigClient.cpp 2008-12-27 22:15:17 UTC (rev 28827) @@ -0,0 +1,31 @@ +/* + * Copyright 2008, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel D?rfler, axeld at pinc-software.de + */ + + +#include "AutoconfigClient.h" + + +AutoconfigClient::AutoconfigClient(const char* name, BMessenger target, + const char* device) + : BHandler(name), + fTarget(target), + fDevice(device) +{ +} + + +AutoconfigClient::~AutoconfigClient() +{ +} + + +status_t +AutoconfigClient::Initialize() +{ + return B_NOT_SUPPORTED; +} Added: haiku/trunk/src/servers/net/AutoconfigClient.h =================================================================== --- haiku/trunk/src/servers/net/AutoconfigClient.h 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/AutoconfigClient.h 2008-12-27 22:15:17 UTC (rev 28827) @@ -0,0 +1,33 @@ +/* + * Copyright 2008, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel D?rfler, axeld at pinc-software.de + */ +#ifndef AUTOCONFIG_CLIENT_H +#define AUTOCONFIG_CLIENT_H + + +#include +#include +#include + + +class AutoconfigClient : public BHandler { +public: + AutoconfigClient(const char* name, + BMessenger target, const char* device); + virtual ~AutoconfigClient(); + + virtual status_t Initialize(); + + const BMessenger& Target() const { return fTarget; } + const char* Device() const { return fDevice.String(); } + +private: + BMessenger fTarget; + BString fDevice; +}; + +#endif // AUTOCONFIG_CLIENT_H Modified: haiku/trunk/src/servers/net/AutoconfigLooper.cpp =================================================================== --- haiku/trunk/src/servers/net/AutoconfigLooper.cpp 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/AutoconfigLooper.cpp 2008-12-27 22:15:17 UTC (rev 28827) @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -8,24 +8,29 @@ #include "AutoconfigLooper.h" -#include "DHCPClient.h" -#include "NetServer.h" #include #include +#include #include #include #include #include +#include +#include "DHCPClient.h" +#include "NetServer.h" + + static const uint32 kMsgReadyToRun = 'rdyr'; AutoconfigLooper::AutoconfigLooper(BMessenger target, const char* device) : BLooper(device), fTarget(target), - fDevice(device) + fDevice(device), + fCurrentClient(NULL) { BMessage ready(kMsgReadyToRun); PostMessage(&ready); @@ -38,8 +43,20 @@ void -AutoconfigLooper::_ReadyToRun() +AutoconfigLooper::_RemoveClient() { + if (fCurrentClient == NULL) + return; + + RemoveHandler(fCurrentClient); + delete fCurrentClient; + fCurrentClient = NULL; +} + + +void +AutoconfigLooper::_Configure() +{ ifreq request; if (!prepare_request(request, fDevice.String())) return; @@ -57,16 +74,19 @@ close(socket); + // remove current handler + + _RemoveClient(); + // start with DHCP - DHCPClient* client = new DHCPClient(fTarget, fDevice.String()); - AddHandler(client); + fCurrentClient = new DHCPClient(fTarget, fDevice.String()); + AddHandler(fCurrentClient); - if (client->Initialize() == B_OK) + if (fCurrentClient->Initialize() == B_OK) return; - RemoveHandler(client); - delete client; + _RemoveClient(); puts("DHCP failed miserably!"); @@ -89,11 +109,11 @@ last = 1; } - char string[64]; // IANA defined the default autoconfig network (for when a DHCP request // fails for some reason) as being 169.254.0.0/255.255.0.0. We are only // generating the last octet but we could also use the 2 last octets if // wanted. + char string[64]; snprintf(string, sizeof(string), "169.254.0.%u", last); BMessage address; @@ -106,6 +126,14 @@ void +AutoconfigLooper::_ReadyToRun() +{ + start_watching_network(B_WATCH_NETWORK_LINK_CHANGES, this); + _Configure(); +} + + +void AutoconfigLooper::MessageReceived(BMessage* message) { switch (message->what) { @@ -113,6 +141,23 @@ _ReadyToRun(); break; + case B_NETWORK_MONITOR: + const char* device; + int32 opcode; + int32 media; + if (message->FindInt32("opcode", &opcode) != B_OK + || opcode != B_NETWORK_DEVICE_LINK_CHANGED + || message->FindString("device", &device) != B_OK + || fDevice != device + || message->FindInt32("media", &media) != B_OK) + break; + + if ((media & IFM_ACTIVE) != 0) { + // Reconfigure the interface when we have a link again + _Configure(); + } + break; + default: BLooper::MessageReceived(message); break; Modified: haiku/trunk/src/servers/net/AutoconfigLooper.h =================================================================== --- haiku/trunk/src/servers/net/AutoconfigLooper.h 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/AutoconfigLooper.h 2008-12-27 22:15:17 UTC (rev 28827) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -13,21 +13,26 @@ #include #include +class AutoconfigClient; class AutoconfigLooper : public BLooper { - public: - AutoconfigLooper(BMessenger target, const char* device); - virtual ~AutoconfigLooper(); +public: + AutoconfigLooper(BMessenger target, + const char* device); + virtual ~AutoconfigLooper(); - virtual void MessageReceived(BMessage* message); + virtual void MessageReceived(BMessage* message); - BMessenger Target() const { return fTarget; } + BMessenger Target() const { return fTarget; } - private: - void _ReadyToRun(); +private: + void _RemoveClient(); + void _Configure(); + void _ReadyToRun(); - BMessenger fTarget; - BString fDevice; + BMessenger fTarget; + BString fDevice; + AutoconfigClient* fCurrentClient; }; #endif // AUTOCONFIG_LOOPER_H Modified: haiku/trunk/src/servers/net/DHCPClient.cpp =================================================================== --- haiku/trunk/src/servers/net/DHCPClient.cpp 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/DHCPClient.cpp 2008-12-27 22:15:17 UTC (rev 28827) @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -329,9 +330,7 @@ DHCPClient::DHCPClient(BMessenger target, const char* device) - : BHandler("dhcp"), - fTarget(target), - fDevice(device), + : AutoconfigClient("dhcp", target, device), fConfiguration(kMsgConfigureInterface), fRunner(NULL), fLeaseTime(0) @@ -347,6 +346,8 @@ fServer.sin_family = AF_INET; fServer.sin_len = sizeof(struct sockaddr_in); fServer.sin_port = htons(DHCP_SERVER_PORT); + + openlog_thread("DHCP", 0, LOG_DAEMON); } @@ -368,6 +369,8 @@ _SendMessage(socket, release, fServer); close(socket); + + closelog_thread(); } @@ -375,7 +378,7 @@ DHCPClient::Initialize() { fStatus = _Negotiate(INIT); - printf("DHCP for %s, status: %s\n", fDevice.String(), strerror(fStatus)); + syslog(LOG_DEBUG, "DHCP for %s, status: %s\n", Device(), strerror(fStatus)); return fStatus; } @@ -416,7 +419,7 @@ if (linkSocket >= 0) { // we need to know the index of the device to be able to bind to it ifreq request; - prepare_request(request, fDevice.String()); + prepare_request(request, Device()); if (ioctl(linkSocket, SIOCGIFINDEX, &request, sizeof(struct ifreq)) == 0) { setsockopt(socket, SOL_SOCKET, SO_BINDTODEVICE, @@ -502,7 +505,7 @@ fAssignedAddress = message->your_address; fConfiguration.MakeEmpty(); - fConfiguration.AddString("device", fDevice.String()); + fConfiguration.AddString("device", Device()); fConfiguration.AddBool("auto", true); BMessage address; @@ -540,7 +543,7 @@ // configure interface BMessage reply; - fTarget.SendMessage(&fConfiguration, &reply); + Target().SendMessage(&fConfiguration, &reply); if (reply.FindInt32("status", &fStatus) != B_OK) status = B_OK; @@ -622,10 +625,11 @@ // TODO: for now, we write it just out to /etc/resolv.conf FILE* file = fopen("/etc/resolv.conf", "w"); for (uint32 i = 0; i < size / 4; i++) { - printf("DNS: %s\n", _ToString(&data[i*4]).String()); + syslog(LOG_INFO, "DNS: %s\n", + _ToString(&data[i * 4]).String()); if (file != NULL) { fprintf(file, "nameserver %s\n", - _ToString(&data[i*4]).String()); + _ToString(&data[i * 4]).String()); } } fclose(file); @@ -636,16 +640,17 @@ break; case OPTION_ADDRESS_LEASE_TIME: - printf("lease time of %lu seconds\n", htonl(*(uint32*)data)); + syslog(LOG_INFO, "lease time of %lu seconds\n", + htonl(*(uint32*)data)); fLeaseTime = htonl(*(uint32*)data) * 1000000LL; break; case OPTION_RENEWAL_TIME: - printf("renewal time of %lu seconds\n", + syslog(LOG_INFO, "renewal time of %lu seconds\n", htonl(*(uint32*)data)); fRenewalTime = htonl(*(uint32*)data) * 1000000LL; break; case OPTION_REBINDING_TIME: - printf("rebinding time of %lu seconds\n", + syslog(LOG_INFO, "rebinding time of %lu seconds\n", htonl(*(uint32*)data)); fRebindingTime = htonl(*(uint32*)data) * 1000000LL; break; @@ -655,7 +660,7 @@ char name[256]; memcpy(name, data, size); name[size] = '\0'; - printf("DHCP host name: \"%s\"\n", name); + syslog(LOG_INFO, "DHCP host name: \"%s\"\n", name); break; } @@ -664,7 +669,7 @@ char name[256]; memcpy(name, data, size); name[size] = '\0'; - printf("DHCP domain name: \"%s\"\n", name); + syslog(LOG_INFO, "DHCP domain name: \"%s\"\n", name); break; } @@ -672,7 +677,7 @@ break; default: - printf("unknown option %lu\n", (uint32)option); + syslog(LOG_INFO, "unknown option %lu\n", (uint32)option); break; } } @@ -754,7 +759,8 @@ if (++tries > 2) return false; } - printf("DHCP timeout shift: %lu secs (try %lu)\n", timeout, tries); + syslog(LOG_DEBUG, "DHCP timeout shift: %lu secs (try %lu)\n", timeout, + tries); struct timeval value; value.tv_sec = timeout; Modified: haiku/trunk/src/servers/net/DHCPClient.h =================================================================== --- haiku/trunk/src/servers/net/DHCPClient.h 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/DHCPClient.h 2008-12-27 22:15:17 UTC (rev 28827) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -9,9 +9,7 @@ #define DHCP_CLIENT_H -#include -#include -#include +#include "AutoconfigClient.h" #include @@ -28,12 +26,12 @@ }; -class DHCPClient : public BHandler { +class DHCPClient : public AutoconfigClient { public: DHCPClient(BMessenger target, const char* device); virtual ~DHCPClient(); - status_t Initialize(); + virtual status_t Initialize(); virtual void MessageReceived(BMessage* message); @@ -49,8 +47,6 @@ BString _ToString(const uint8* data) const; BString _ToString(in_addr_t address) const; - BMessenger fTarget; - BString fDevice; BMessage fConfiguration; BMessageRunner* fRunner; uint8 fMAC[6]; Modified: haiku/trunk/src/servers/net/Jamfile =================================================================== --- haiku/trunk/src/servers/net/Jamfile 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/Jamfile 2008-12-27 22:15:17 UTC (rev 28827) @@ -11,6 +11,7 @@ Server net_server : NetServer.cpp Settings.cpp + AutoconfigClient.cpp AutoconfigLooper.cpp DHCPClient.cpp Services.cpp Modified: haiku/trunk/src/servers/net/NetServer.cpp =================================================================== --- haiku/trunk/src/servers/net/NetServer.cpp 2008-12-27 22:12:08 UTC (rev 28826) +++ haiku/trunk/src/servers/net/NetServer.cpp 2008-12-27 22:15:17 UTC (rev 28827) @@ -7,11 +7,23 @@ */ -#include "AutoconfigLooper.h" #include "NetServer.h" -#include "Services.h" -#include "Settings.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + #include #include #include @@ -22,26 +34,15 @@ #include #include -#include -#include -#include -#include -#include -#include +#include "AutoconfigLooper.h" +#include "Services.h" +#include "Settings.h" -#include -#include -#include -#include -#include -#include -#include - static const char *kSignature = "application/x-vnd.haiku-net_server"; -typedef std::map LooperMap; +typedef std::map LooperMap; class NetServer : public BServer { @@ -59,7 +60,7 @@ status_t _ConfigureInterface(int socket, BMessage& interface, bool fromMessage = false); bool _QuitLooperForDevice(const char* device); - BLooper* _LooperForDevice(const char* device); + AutoconfigLooper* _LooperForDevice(const char* device); status_t _ConfigureDevice(int socket, const char* path); void _ConfigureDevices(int socket, const char* path, BMessage* suggestedInterface = NULL); @@ -258,7 +259,7 @@ view->GetFont(&font); font.SetSize(18); - font.SetFace(B_BOLD_FACE); + font.SetFace(B_BOLD_FACE); view->SetFontAndColor(0, 17, &font); alert->Go(NULL); @@ -363,7 +364,7 @@ if (addresses == 0) return false; - // check if it has a hardware address, too, in case of ethernet + // check if it has a hardware address, too, in case of ethernet if (ioctl(socket, SIOCGIFPARAM, &request, sizeof(struct ifreq)) < 0) return false; @@ -568,7 +569,7 @@ if (addressMessage.FindString("address", &string) == B_OK && parse_address(familyIndex, string, address)) { hasAddress = true; - + if (addressMessage.FindString("mask", &string) == B_OK && parse_address(familyIndex, string, mask)) hasMask = true; @@ -612,13 +613,13 @@ if (hasAddress) { memcpy(&request.ifr_addr, &address, address.sa_len); - + if (ioctl(familySocket, SIOCSIFADDR, &request, sizeof(struct ifreq)) < 0) { fprintf(stderr, "%s: Setting address failed: %s\n", Name(), strerror(errno)); continue; } } - + if (ioctl(familySocket, SIOCGIFFLAGS, &request, sizeof(struct ifreq)) < 0) { fprintf(stderr, "%s: Getting flags failed: %s\n", Name(), strerror(errno)); continue; @@ -695,15 +696,15 @@ return false; // there is a looper for this device - quit it - iterator->second->Lock(); - iterator->second->Quit(); + if (iterator->second->Lock()) + iterator->second->Quit(); fDeviceMap.erase(iterator); return true; } -BLooper* +AutoconfigLooper* NetServer::_LooperForDevice(const char* device) { LooperMap::const_iterator iterator = fDeviceMap.find(device); From anevilyak at mail.berlios.de Sun Dec 28 07:58:12 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sun, 28 Dec 2008 07:58:12 +0100 Subject: [Haiku-commits] r28828 - haiku/trunk/src/kits/tracker Message-ID: <200812280658.mBS6wC2E025343@sheep.berlios.de> Author: anevilyak Date: 2008-12-28 07:58:11 +0100 (Sun, 28 Dec 2008) New Revision: 28828 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28828&view=rev Modified: haiku/trunk/src/kits/tracker/PoseView.cpp Log: When drag and dropping a text file, Tracker would refuse to extract the text (and style attributes, if any) if the file in question didn't have both the text/plain filetype *and* Tracker's clipping attribute. Since I was unable to find any good reason whatsoever to check for the latter, I removed this. Fixes the reported problems where drag and dropping a file onto a BTextView would do nothing unless the clipping attribute existed as well. Modified: haiku/trunk/src/kits/tracker/PoseView.cpp =================================================================== --- haiku/trunk/src/kits/tracker/PoseView.cpp 2008-12-27 22:15:17 UTC (rev 28827) +++ haiku/trunk/src/kits/tracker/PoseView.cpp 2008-12-28 06:58:11 UTC (rev 28828) @@ -6451,12 +6451,10 @@ info.GetType(type); int32 tmp; - if (strcasecmp(type, kPlainTextMimeType) == 0 + if (strcasecmp(type, kPlainTextMimeType) == 0) { // got a text file - && file.ReadAttr(kAttrClippingFile, B_RAW_TYPE, 0, - &tmp, sizeof(int32)) == sizeof(int32)) { - // and a clipping file + file.Seek(0, SEEK_SET); off_t size = 0; file.GetSize(&size); From anevilyak at mail.berlios.de Sun Dec 28 21:57:22 2008 From: anevilyak at mail.berlios.de (anevilyak at BerliOS) Date: Sun, 28 Dec 2008 21:57:22 +0100 Subject: [Haiku-commits] r28829 - haiku/trunk/src/apps/packageinstaller Message-ID: <200812282057.mBSKvMnd029634@sheep.berlios.de> Author: anevilyak Date: 2008-12-28 21:57:21 +0100 (Sun, 28 Dec 2008) New Revision: 28829 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28829&view=rev Modified: haiku/trunk/src/apps/packageinstaller/PackageInfo.cpp haiku/trunk/src/apps/packageinstaller/PackageInfo.h Log: Patch by Lukasz Zemczak: fix installer crashes reported in ticket #2969. Modified: haiku/trunk/src/apps/packageinstaller/PackageInfo.cpp =================================================================== --- haiku/trunk/src/apps/packageinstaller/PackageInfo.cpp 2008-12-28 06:58:11 UTC (rev 28828) +++ haiku/trunk/src/apps/packageinstaller/PackageInfo.cpp 2008-12-28 20:57:21 UTC (rev 28829) @@ -1092,7 +1092,9 @@ // Add the item to all groups it resides in uint32 i, n = fProfiles.CountItems(), mask = 1; pkg_profile *profile; - + + fFiles.AddItem(item); + for (i = 0;i < n;i++) { if (groups & mask) { profile = static_cast(fProfiles.ItemAt(i)); @@ -1117,19 +1119,3 @@ } } - -// #pragma mark - - - -pkg_profile::~pkg_profile() -{ - PkgItem *iter = 0; - while (1) { - iter = static_cast(items.RemoveItem((long int)0)); - if (iter) - delete iter; - else - break; - } -} - Modified: haiku/trunk/src/apps/packageinstaller/PackageInfo.h =================================================================== --- haiku/trunk/src/apps/packageinstaller/PackageInfo.h 2008-12-28 06:58:11 UTC (rev 28828) +++ haiku/trunk/src/apps/packageinstaller/PackageInfo.h 2008-12-28 20:57:21 UTC (rev 28829) @@ -64,7 +64,7 @@ struct pkg_profile { pkg_profile() : items(10), space_needed(0), path_type(P_SYSTEM_PATH) {} - ~pkg_profile(); + ~pkg_profile() {} BString name; BString description; From axeld at mail.berlios.de Sun Dec 28 23:13:20 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 28 Dec 2008 23:13:20 +0100 Subject: [Haiku-commits] r28830 - haiku/trunk/src/add-ons/kernel/network/stack Message-ID: <200812282213.mBSMDKX9005712@sheep.berlios.de> Author: axeld Date: 2008-12-28 23:13:19 +0100 (Sun, 28 Dec 2008) New Revision: 28830 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28830&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp Log: * It was not possible anymore to remove any flags. Modified: haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2008-12-28 20:57:21 UTC (rev 28829) +++ haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2008-12-28 22:13:19 UTC (rev 28830) @@ -252,8 +252,11 @@ } } - if (status == B_OK) + if (status == B_OK) { + // TODO: why shouldn't we able to delete IFF_BROADCAST? + interface->flags &= IFF_UP | IFF_LINK | IFF_BROADCAST; interface->flags |= request->ifr_flags; + } break; } } From axeld at mail.berlios.de Sun Dec 28 23:18:21 2008 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 28 Dec 2008 23:18:21 +0100 Subject: [Haiku-commits] r28831 - in haiku/trunk/src: bin/network/ifconfig servers/net Message-ID: <200812282218.mBSMIL0t006051@sheep.berlios.de> Author: axeld Date: 2008-12-28 23:18:21 +0100 (Sun, 28 Dec 2008) New Revision: 28831 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=28831&view=rev Modified: haiku/trunk/src/bin/network/ifconfig/Jamfile haiku/trunk/src/bin/network/ifconfig/ifconfig.cpp haiku/trunk/src/servers/net/NetServer.cpp haiku/trunk/src/servers/net/NetServer.h Log: * The net_server now accepts messages from the outside that want to configure an interface (I don't remember why I didn't want this earlier, but well). * ifconfig now has an auto-config option that will trigger DHCP. * Also, it will now remove the IFF_AUTO_CONFIGURED and IFF_CONFIGURING flags if an address is specified (any on-going auto-configuration should check for these and abort if they aren't there anymore). Modified: haiku/trunk/src/bin/network/ifconfig/Jamfile =================================================================== --- haiku/trunk/src/bin/network/ifconfig/Jamfile 2008-12-28 22:13:19 UTC (rev 28830) +++ haiku/trunk/src/bin/network/ifconfig/Jamfile 2008-12-28 22:18:21 UTC (rev 28831) @@ -6,9 +6,11 @@ # Unfortunately we get more than we want, namely all POSIX headers. } +UseHeaders [ FDirName $(HAIKU_TOP) src servers net ] : true ; + BinCommand ifconfig : ifconfig.cpp - : libnetwork.so + : be network ; # Installation -- in the test directory for the time being @@ -16,7 +18,7 @@ : [ FDirName $(HAIKU_TEST_DIR) kits net ] : ifconfig ; -HaikuInstall install-userland-networking +HaikuInstall install-userland-networking : [ FDirName $(HAIKU_TEST_DIR) kits net userland ] : ifconfig : installed-userland-networking Modified: haiku/trunk/src/bin/network/ifconfig/ifconfig.cpp =================================================================== --- haiku/trunk/src/bin/network/ifconfig/ifconfig.cpp 2008-12-28 22:13:19 UTC (rev 28830) +++ haiku/trunk/src/bin/network/ifconfig/ifconfig.cpp 2008-12-28 22:18:21 UTC (rev 28831) @@ -8,7 +8,8 @@ */ -#include +#include +#include #include #include @@ -25,7 +26,9 @@ #include #include +#include + extern const char* __progname; const char* kProgramName = __progname; @@ -63,7 +66,7 @@ return false; sockaddr_in& address = *(sockaddr_in *)_address; - address.sin_family = AF_INET; + address.sin_family = AF_INET; address.sin_len = sizeof(struct sockaddr_in); address.sin_port = 0; address.sin_addr = inetAddress; @@ -77,7 +80,7 @@ inet_print_address(sockaddr* _address) { sockaddr_in& address = *(sockaddr_in *)_address; - + if (address.sin_family != AF_INET) return; @@ -153,7 +156,7 @@ { for (int32 i = 0; kMediaTypes[i].type >= 0; i++) { // only check for generic or correct subtypes - if (kMediaTypes[i].type && + if (kMediaTypes[i].type && kMediaTypes[i].type != media) continue; for (int32 j = 0; kMediaTypes[i].subtypes[j].subtype >= 0; j++) { @@ -174,7 +177,8 @@ void usage(int status) { - printf("usage: %s [ [
] [
[]] [