]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/myri10ge/myri10ge.c
myri10ge: fix management of >4kB allocated pages
[linux-2.6-omap-h63xx.git] / drivers / net / myri10ge / myri10ge.c
index 2449b9fd73628ca506b486835014f4bb23a9cd44..c89ca3fec1614c9dc4cbfbda0ef5f4860bfa7638 100644 (file)
@@ -905,6 +905,14 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
                    (rx->page_offset + bytes <= MYRI10GE_ALLOC_SIZE)) {
                        /* we can use part of previous page */
                        get_page(rx->page);
+#if MYRI10GE_ALLOC_SIZE > 4096
+                       /* Firmware cannot cross 4K boundary.. */
+                       if ((rx->page_offset >> 12) !=
+                           ((rx->page_offset + bytes - 1) >> 12)) {
+                               rx->page_offset =
+                                   (rx->page_offset + bytes) & ~4095;
+                       }
+#endif
                } else {
                        /* we need a new page */
                        page =