public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] misc fixes for eCos 3.0
@ 2010-02-21 17:10 Andreas Oberritter
  2010-02-21 17:10 ` [PATCH 1/3] usbs_at91: call vendor_control_fn on USB_DEVREQ_TYPE_VENDOR Andreas Oberritter
  2010-02-22 11:54 ` [PATCH 0/3] misc fixes for eCos 3.0 Gary Thomas
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Oberritter @ 2010-02-21 17:10 UTC (permalink / raw)
  To: ecos-patches

Hello,

here are some random patches I created while building eCos for the AT91
platform using the OpenBSD TCP/IP stack. Please apply them, if you find
them useful.

Regards,
Andreas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] usbseth: compile fix: move misplaced #endif
  2010-02-21 17:10 ` [PATCH 1/3] usbs_at91: call vendor_control_fn on USB_DEVREQ_TYPE_VENDOR Andreas Oberritter
@ 2010-02-21 17:10   ` Andreas Oberritter
  2010-02-21 17:10     ` [PATCH 3/3] tcpip: compile fix: remove unneeded cast to long in TCPT_RANGESET Andreas Oberritter
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Oberritter @ 2010-02-21 17:10 UTC (permalink / raw)
  To: ecos-patches; +Cc: Andreas Oberritter

---
 packages/io/usb/eth/slave/v3_0/src/usbseth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/packages/io/usb/eth/slave/v3_0/src/usbseth.c b/packages/io/usb/eth/slave/v3_0/src/usbseth.c
index 8d0cd7e..08c2139 100644
--- a/packages/io/usb/eth/slave/v3_0/src/usbseth.c
+++ b/packages/io/usb/eth/slave/v3_0/src/usbseth.c
@@ -108,9 +108,9 @@ usbs_eth_init(usbs_eth* eth, usbs_control_endpoint* ctrl, usbs_rx_endpoint* rx,
 # ifndef HAL_DCACHE_LINE_SIZE
     eth->rx_bufptr              = eth->rx_buffer;
 # else
-# endif    
     eth->rx_bufptr              = (unsigned char*) ((((cyg_uint32)eth->rx_buffer) + HAL_DCACHE_LINE_SIZE - 1)
                                                     & ~(HAL_DCACHE_LINE_SIZE - 1));
+# endif
     eth->rx_buffer_full         = false;
     eth->tx_in_send             = false;
     eth->tx_buffer_full         = false;
-- 
1.6.3.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] tcpip: compile fix: remove unneeded cast to long in TCPT_RANGESET
  2010-02-21 17:10   ` [PATCH 2/3] usbseth: compile fix: move misplaced #endif Andreas Oberritter
@ 2010-02-21 17:10     ` Andreas Oberritter
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Oberritter @ 2010-02-21 17:10 UTC (permalink / raw)
  To: ecos-patches; +Cc: Andreas Oberritter

---
 .../net/tcpip/v3_0/src/sys/netinet/tcp_input.c     |    2 +-
 .../net/tcpip/v3_0/src/sys/netinet/tcp_timer.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/net/tcpip/v3_0/src/sys/netinet/tcp_input.c b/packages/net/tcpip/v3_0/src/sys/netinet/tcp_input.c
index a91fc73..b7a4ad9 100644
--- a/packages/net/tcpip/v3_0/src/sys/netinet/tcp_input.c
+++ b/packages/net/tcpip/v3_0/src/sys/netinet/tcp_input.c
@@ -2836,7 +2836,7 @@ tcp_mss(tp, offer)
 			/* default variation is +- 1 rtt */
 			tp->t_rttvar =
 			    tp->t_srtt * TCP_RTTVAR_SCALE / TCP_RTT_SCALE;
-		TCPT_RANGESET((long) tp->t_rxtcur,
+		TCPT_RANGESET(tp->t_rxtcur,
 		    ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1,
 		    tp->t_rttmin, TCPTV_REXMTMAX);
 	}
diff --git a/packages/net/tcpip/v3_0/src/sys/netinet/tcp_timer.c b/packages/net/tcpip/v3_0/src/sys/netinet/tcp_timer.c
index e3b91d4..514b76b 100644
--- a/packages/net/tcpip/v3_0/src/sys/netinet/tcp_timer.c
+++ b/packages/net/tcpip/v3_0/src/sys/netinet/tcp_timer.c
@@ -265,7 +265,7 @@ tcp_timers(tp, timer)
 		rto = TCP_REXMTVAL(tp);
 		if (rto < tp->t_rttmin)
 			rto = tp->t_rttmin;
-		TCPT_RANGESET((long) tp->t_rxtcur,
+		TCPT_RANGESET(tp->t_rxtcur,
 		    rto * tcp_backoff[tp->t_rxtshift],
 		    tp->t_rttmin, TCPTV_REXMTMAX);
 		tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-- 
1.6.3.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] usbs_at91: call vendor_control_fn on USB_DEVREQ_TYPE_VENDOR
  2010-02-21 17:10 [PATCH 0/3] misc fixes for eCos 3.0 Andreas Oberritter
@ 2010-02-21 17:10 ` Andreas Oberritter
  2010-02-21 17:10   ` [PATCH 2/3] usbseth: compile fix: move misplaced #endif Andreas Oberritter
  2010-02-22 11:54 ` [PATCH 0/3] misc fixes for eCos 3.0 Gary Thomas
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Oberritter @ 2010-02-21 17:10 UTC (permalink / raw)
  To: ecos-patches; +Cc: Andreas Oberritter

---
 packages/devs/usb/at91/v3_0/src/usbs_at91.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/devs/usb/at91/v3_0/src/usbs_at91.c b/packages/devs/usb/at91/v3_0/src/usbs_at91.c
index 23d3e1e..063d841 100644
--- a/packages/devs/usb/at91/v3_0/src/usbs_at91.c
+++ b/packages/devs/usb/at91/v3_0/src/usbs_at91.c
@@ -559,10 +559,10 @@ usbs_parse_host_get_command (usbs_control_endpoint * pcep)
       return (*pcep->class_control_fn) (pcep, pcep->class_control_data);
 
     case USB_DEVREQ_TYPE_VENDOR: 
-      if (!pcep->class_control_fn) {
+      if (!pcep->vendor_control_fn) {
         return USBS_CONTROL_RETURN_STALL;
       }
-      return (*pcep->class_control_fn) (pcep, pcep->vendor_control_data);
+      return (*pcep->vendor_control_fn) (pcep, pcep->vendor_control_data);
 
     case USB_DEVREQ_TYPE_RESERVED:
       if (!pcep->reserved_control_fn) {
-- 
1.6.3.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] misc fixes for eCos 3.0
  2010-02-21 17:10 [PATCH 0/3] misc fixes for eCos 3.0 Andreas Oberritter
  2010-02-21 17:10 ` [PATCH 1/3] usbs_at91: call vendor_control_fn on USB_DEVREQ_TYPE_VENDOR Andreas Oberritter
@ 2010-02-22 11:54 ` Gary Thomas
  2010-02-22 12:51   ` Andreas Oberritter
  1 sibling, 1 reply; 6+ messages in thread
From: Gary Thomas @ 2010-02-22 11:54 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: ecos-patches

  On 02/21/2010 10:09 AM, Andreas Oberritter wrote:
> Hello,
>
> here are some random patches I created while building eCos for the AT91
> platform using the OpenBSD TCP/IP stack. Please apply them, if you find
> them useful.
>
> Regards,
> Andreas

Not much use without some explanation of what they do.
Accepted practice is to explain each change, so it can be
properly understood and discussed.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] misc fixes for eCos 3.0
  2010-02-22 11:54 ` [PATCH 0/3] misc fixes for eCos 3.0 Gary Thomas
@ 2010-02-22 12:51   ` Andreas Oberritter
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Oberritter @ 2010-02-22 12:51 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-patches

Gary Thomas wrote:
> Not much use without some explanation of what they do.
> Accepted practice is to explain each change, so it can be
> properly understood and discussed.

I thought that the reason for these changes were pretty obvious. I'll
try to explain them now, though:

[PATCH 1/3] usbs_at91: call vendor_control_fn on USB_DEVREQ_TYPE_VENDOR:

For each type of USB control requests (USB_DEVREQ_TYPE_XXX), there is
a callback function called xxx_control_fn(). For vendor requests, the
wrong function was called. It looks like a copy and paste bug. The
function class_control_fn() should only be called for
USB_DEVREQ_TYPE_CLASS.

[PATCH 2/3] usbseth: compile fix: move misplaced #endif:

Compilation aborted, because HAL_DCACHE_LINE_SIZE was not defined. A
look at the code revealed, that the following code does not make sense:

#ifndef XXX
x = expr;
#else
#endif
x = expr using XXX;

[PATCH 3/3] tcpip: compile fix: remove unneeded cast to long in
TCPT_RANGESET:

Compilation aborted using the toolchain supplied by the eCos installer
(gcc 4.3.2), because of an invalid cast:

error: "lvalue required as left operand of assignment"

Therefore, TCPT_RANGESET was adjusted in two places to match the usage
pattern of other users of this macro, which simply omit the cast.

Regards,
Andreas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-22 12:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-21 17:10 [PATCH 0/3] misc fixes for eCos 3.0 Andreas Oberritter
2010-02-21 17:10 ` [PATCH 1/3] usbs_at91: call vendor_control_fn on USB_DEVREQ_TYPE_VENDOR Andreas Oberritter
2010-02-21 17:10   ` [PATCH 2/3] usbseth: compile fix: move misplaced #endif Andreas Oberritter
2010-02-21 17:10     ` [PATCH 3/3] tcpip: compile fix: remove unneeded cast to long in TCPT_RANGESET Andreas Oberritter
2010-02-22 11:54 ` [PATCH 0/3] misc fixes for eCos 3.0 Gary Thomas
2010-02-22 12:51   ` Andreas Oberritter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).