OpenWrt – Diff between revs 2 and 3

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 2 Rev 3
Line 185... Line 185...
185 /* 185 /*
186 * buffer manage functions 186 * buffer manage functions
187 */ 187 */
188 static inline struct sk_buff* alloc_skb_rx(void); 188 static inline struct sk_buff* alloc_skb_rx(void);
189 static inline struct sk_buff* alloc_skb_tx(unsigned int); 189 static inline struct sk_buff* alloc_skb_tx(unsigned int);
-   190 struct sk_buff* atm_alloc_tx(struct atm_vcc *, unsigned int);
190 static inline void atm_free_tx_skb_vcc(struct sk_buff *, struct atm_vcc *); 191 static inline void atm_free_tx_skb_vcc(struct sk_buff *, struct atm_vcc *);
191 static inline struct sk_buff *get_skb_rx_pointer(unsigned int); 192 static inline struct sk_buff *get_skb_rx_pointer(unsigned int);
192 static inline int get_tx_desc(unsigned int); 193 static inline int get_tx_desc(unsigned int);
Line 193... Line 194...
193   194  
Line 258... Line 259...
258 int (*ifx_mei_atm_showtime_exit)(void) = NULL; 259 int (*ifx_mei_atm_showtime_exit)(void) = NULL;
259 EXPORT_SYMBOL(ifx_mei_atm_showtime_exit); 260 EXPORT_SYMBOL(ifx_mei_atm_showtime_exit);
Line 260... Line 261...
260   261  
Line -... Line 262...
-   262 #endif
-   263  
261 #endif 264 static struct sk_buff* (*ifx_atm_alloc_tx)(struct atm_vcc *, unsigned int) = NULL;
Line 262... Line 265...
262   265  
263 static struct atm_priv_data g_atm_priv_data; 266 static struct atm_priv_data g_atm_priv_data;
264   267  
Line 425... Line 428...
425 vcc->vci = vci; 428 vcc->vci = vci;
426 set_bit(ATM_VF_READY, &vcc->flags); 429 set_bit(ATM_VF_READY, &vcc->flags);
Line 427... Line 430...
427   430  
428 /* enable irq */ 431 /* enable irq */
-   432 if ( f_enable_irq ) {
-   433 ifx_atm_alloc_tx = atm_alloc_tx;
429 if ( f_enable_irq ) { 434  
430 *MBOX_IGU1_ISRC = (1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM); 435 *MBOX_IGU1_ISRC = (1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM);
Line 431... Line 436...
431 *MBOX_IGU1_IER = (1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM); 436 *MBOX_IGU1_IER = (1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM);
432   437  
Line 473... Line 478...
473 connection->aal5_vcc_crc_err = 0; 478 connection->aal5_vcc_crc_err = 0;
474 connection->aal5_vcc_oversize_sdu = 0; 479 connection->aal5_vcc_oversize_sdu = 0;
475 clear_bit(conn, &g_atm_priv_data.conn_table); 480 clear_bit(conn, &g_atm_priv_data.conn_table);
Line 476... Line 481...
476   481  
477 /* disable irq */ 482 /* disable irq */
478 if ( g_atm_priv_data.conn_table == 0 ) 483 if ( g_atm_priv_data.conn_table == 0 ) {
-   484 disable_irq(PPE_MAILBOX_IGU1_INT);
-   485 ifx_atm_alloc_tx = NULL;
Line 479... Line 486...
479 disable_irq(PPE_MAILBOX_IGU1_INT); 486 }
480   487  
481 /* release bandwidth */ 488 /* release bandwidth */
482 switch ( vcc->qos.txtp.traffic_class ) 489 switch ( vcc->qos.txtp.traffic_class )
Line 776... Line 783...
776 if ( skb != NULL ) 783 if ( skb != NULL )
777 skb_reserve(skb, (~((unsigned int)skb->data + (DATA_BUFFER_ALIGNMENT - 1)) & (DATA_BUFFER_ALIGNMENT - 1)) + TX_INBAND_HEADER_LENGTH); 784 skb_reserve(skb, (~((unsigned int)skb->data + (DATA_BUFFER_ALIGNMENT - 1)) & (DATA_BUFFER_ALIGNMENT - 1)) + TX_INBAND_HEADER_LENGTH);
778 return skb; 785 return skb;
779 } 786 }
Line -... Line 787...
-   787  
-   788 struct sk_buff* atm_alloc_tx(struct atm_vcc *vcc, unsigned int size)
-   789 {
-   790 int conn;
-   791 struct sk_buff *skb;
-   792  
-   793 /* oversize packet */
-   794 if ( size > aal5s_max_packet_size ) {
-   795 pr_err("atm_alloc_tx: oversize packet\n");
-   796 return NULL;
-   797 }
-   798 /* send buffer overflow */
-   799 if ( sk_wmem_alloc_get(sk_atm(vcc)) && !atm_may_send(vcc, size) ) {
-   800 pr_err("atm_alloc_tx: send buffer overflow\n");
-   801 return NULL;
-   802 }
-   803 conn = find_vcc(vcc);
-   804 if ( conn < 0 ) {
-   805 pr_err("atm_alloc_tx: unknown VCC\n");
-   806 return NULL;
-   807 }
-   808  
-   809 skb = dev_alloc_skb(size);
-   810 if ( skb == NULL ) {
-   811 pr_err("atm_alloc_tx: sk buffer is used up\n");
-   812 return NULL;
-   813 }
-   814  
-   815 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
-   816 refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
-   817 #else
-   818 atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
-   819 #endif
-   820  
-   821 return skb;
-   822 }
780   823  
781 static inline void atm_free_tx_skb_vcc(struct sk_buff *skb, struct atm_vcc *vcc) 824 static inline void atm_free_tx_skb_vcc(struct sk_buff *skb, struct atm_vcc *vcc)
782 { 825 {
783 if ( vcc->pop != NULL ) 826 if ( vcc->pop != NULL )
784 vcc->pop(vcc, skb); 827 vcc->pop(vcc, skb);