--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -57,7 +57,7 @@ #define POOL_ALLOC_SIZE (sizeof(struct desc) * (RX_DESCS + TX_DESCS)) #define REGS_SIZE 0x1000 -#define MAX_MRU 1536 /* 0x600 */ +#define MAX_MRU (14320 - ETH_HLEN - ETH_FCS_LEN) #define RX_BUFF_SIZE ALIGN((NET_IP_ALIGN) + MAX_MRU, 4) #define NAPI_WEIGHT 16 @@ -1289,6 +1289,32 @@ static void destroy_queues(struct port * } } +static int eth_do_change_mtu(struct net_device *dev, int mtu) +{ + struct port *port; + struct msg msg; + /* adjust for ethernet headers */ + int framesize = mtu + ETH_HLEN + ETH_FCS_LEN; + + port = netdev_priv(dev); + + memset(&msg, 0, sizeof(msg)); + msg.cmd = NPE_SETMAXFRAMELENGTHS; + msg.eth_id = port->id; + + /* max rx/tx 64 byte blocks */ + msg.byte2 = ((framesize + 63) / 64) << 8; + msg.byte3 = ((framesize + 63) / 64) << 8; + + msg.byte4 = msg.byte6 = framesize >> 8; + msg.byte5 = msg.byte7 = framesize & 0xff; + + if (npe_send_recv_message(port->npe, &msg, "ETH_SET_MAX_FRAME_LENGTH")) + return -EIO; + + return 0; +} + static int eth_open(struct net_device *dev) { struct port *port = netdev_priv(dev); @@ -1340,6 +1366,8 @@ static int eth_open(struct net_device *d if (npe_send_recv_message(port->npe, &msg, "ETH_SET_FIREWALL_MODE")) return -EIO; + eth_do_change_mtu(dev, dev->mtu); + if ((err = request_queues(port)) != 0) return err; @@ -1479,7 +1507,26 @@ static int eth_close(struct net_device * return 0; } +static int ixp_eth_change_mtu(struct net_device *dev, int mtu) +{ + int ret; + + if (mtu > MAX_MRU) + return -EINVAL; + + if (dev->flags & IFF_UP) { + ret = eth_do_change_mtu(dev, mtu); + if (ret < 0) + return ret; + } + + dev->mtu = mtu; + + return 0; +} + static const struct net_device_ops ixp4xx_netdev_ops = { + .ndo_change_mtu = ixp_eth_change_mtu, .ndo_open = eth_open, .ndo_stop = eth_close, .ndo_start_xmit = eth_xmit, yboards/meme/keymaps/default/keymap.c'>stats
path: root/keyboards/meme/keymaps/default/keymap.c
blob: f7df8aa4fc15f94b05d07fb4e0f42e1ced331e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Copyright 2018 MechMerlin
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[0] = LAYOUT_spicy(\
    KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSLS, KC_BSPC, KC_INS,
    KC_TAB,  KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
    KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K,    KC_L,    KC_SCLN, KC_QUOT, KC_ENT,  KC_PGUP,
    KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT, KC_UP,   KC_PGDN,
    KC_LCTL, KC_LGUI, KC_LALT,       KC_SPACE,         KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
  )
};