On 05/15/2017 02:01 PM, woojung@microchip.com wrote:
>>> +static const struct ksz_chip_data ksz_switch_chips[] = {
>>> + {
>>> + .chip_id = 0x00947700,
>>> + .dev_name = "KSZ9477",
>>> + .num_vlans = 4096,
>>> + .num_alus = 4096,
>>> + .num_st
> > +static const struct ksz_chip_data ksz_switch_chips[] = {
> > + {
> > + .chip_id = 0x00947700,
> > + .dev_name = "KSZ9477",
> > + .num_vlans = 4096,
> > + .num_alus = 4096,
> > + .num_statics = 16,
> > + .enabled_ports = 0x1F, /* po
> >> + dev->vlan_cache = devm_kmalloc_array(dev->dev,
> >> + sizeof(struct vlan_table),
> >> + dev->num_vlans, GFP_KERNEL);
> >
> > You should check, but i think devm_kmalloc_array sets the allocated
> > memory to 0.
>
>
Hello!
On 5/13/2017 5:56 PM, Andrew Lunn wrote:
[...]
+static int ksz_reset_switch(struct dsa_switch *ds)
+{
+ struct ksz_device *dev = ds->priv;
+ u8 data8;
+ u16 data16;
+ u32 data32;
+
...
+
+ memset(dev->vlan_cache, 0, sizeof(*dev->vlan_cache) * dev->num_v
> +static int get_vlan_table(struct dsa_switch *ds, u16 vid, u32 *vlan_table)
> +{
> + struct ksz_device *dev = ds->priv;
> + u8 data;
> + int timeout = 1000;
> +
> + ksz_write16(dev, REG_SW_VLAN_ENTRY_INDEX__2, vid & VLAN_INDEX_M);
> + ksz_write8(dev, REG_SW_VLAN_CTRL, VLAN_REA
On Fri, May 12, 2017 at 08:07:58PM +, woojung@microchip.com wrote:
> +static void ksz_config_cpu_port(struct dsa_switch *ds)
> +{
> + struct ksz_device *dev = ds->priv;
> + int i;
> +
> + ds->num_ports = dev->port_cnt;
> +
> + for (i = 0; i < ds->num_ports; i++) {
> +