rewrite for 3.0.76+ kernel